/* ===============================================
   THE MYSTIC EMPORIUM - Fantasy Shop Styles
   =============================================== */

/* CSS Variables - Colors from the potion shop aesthetic */
:root {
    /* Primary palette - Warm wood tones */
    --wood-dark: #3d2817;
    --wood-medium: #5c3d24;
    --wood-light: #8b6140;
    --wood-accent: #a67c52;
    
    /* Banner colors */
    --banner-teal: #4a9b8c;
    --banner-blue: #3a7ca5;
    --banner-red: #a65353;
    --banner-gold: #c9a227;
    --banner-purple: #7a5493;
    
    /* UI colors */
    --parchment: #e8dcc4;
    --parchment-dark: #d4c4a8;
    --ink: #2a1f14;
    --gold-glow: #ffd700;
    --magic-cyan: #7dd3d8;
    
    /* Gradients */
    --wood-gradient: linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    --parchment-gradient: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    --gold-border: linear-gradient(135deg, #8b6914 0%, #ffd700 50%, #8b6914 100%);
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.3);
    --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow: hidden;
}

body {
    font-family: 'Almendra', serif;
    background: #1a0f0a;
    color: var(--parchment);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ===============================================
   INTRO MODAL
   =============================================== */
.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(30, 20, 12, 0.95) 0%, rgba(10, 5, 2, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.intro-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.intro-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.intro-title h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--gold-glow);
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.1em;
    margin: 0;
}

.intro-icon {
    font-size: clamp(2rem, 5vw, 3rem);
    animation: float 3s ease-in-out infinite;
}

.intro-icon:last-child {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.intro-text {
    font-family: 'Almendra', serif;
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--parchment);
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.enter-shop-btn {
    font-family: 'Cinzel', serif;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-xl);
    background: linear-gradient(180deg, var(--banner-gold) 0%, #8b6914 100%);
    border: 3px solid var(--gold-glow);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.6), 0 4px 20px rgba(0, 0, 0, 0.5); }
}

.enter-shop-btn:hover {
    background: linear-gradient(180deg, #e0c035 0%, var(--banner-gold) 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.6),
        0 8px 25px rgba(0, 0, 0, 0.5);
}

.enter-shop-btn:active {
    transform: translateY(0);
}

/* ===============================================
   BACKGROUND LAYERS
   =============================================== */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.bg-static,
.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.bg-video {
    opacity: 0;
    transition: opacity 1s ease;
}

.bg-video.active {
    opacity: 1;
}

.bg-static {
    opacity: 1;
    transition: opacity 1s ease;
}

.bg-static.hidden {
    opacity: 0;
}

/* Background zooms in browse mode */
.background-layer {
    transition: transform 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
    transform-origin: 50% 60%;
}

.background-layer.browse-mode {
    transform: scale(1.25);
}

/* Ambient overlay for atmosphere */
.ambient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none !important;
    background:
        radial-gradient(ellipse at 50% 0%, transparent 0%, rgba(20, 12, 8, 0.4) 70%),
        radial-gradient(ellipse at 50% 100%, rgba(20, 12, 8, 0.8) 0%, transparent 50%);
}

/* ===============================================
   CAMERA RIG SYSTEM - Full viewport camera transforms
   =============================================== */

/* The camera rig - this is what we transform */
.camera-rig {
    position: fixed;
    inset: 0;
    perspective: 1500px;
    perspective-origin: 50% 40%;
    overflow: hidden;
    z-index: 1;
    /* Force GPU compositing */
    transform: translateZ(0);
    will-change: contents;
}

/* The 3D scene that gets transformed */
.scene-3d {
    position: absolute;
    width: 100%;
    height: 150%; /* Extra height for the full scene */
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    /* Initial state - front view */
    transform: translateY(0) scale(1);
}

/* BROWSE MODE - Scene zooms in and pushes up
   NOTE: NO rotateX here - only the table tilts! */
.scene-3d.browse-mode {
    transform: 
        translateY(-30vh)      /* Push scene UP (shopkeeper moves up) */
        scale(1.4);            /* Zoom IN more */
}

/* ===============================================
   SHOPKEEPER LAYER - The merchant character (BEHIND table)
   =============================================== */
.shopkeeper-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
    /* Push avatar BACK in 3D space so table is in front */
    transform: translateZ(-50px);
}

.shopkeeper-layer .character-container {
    position: relative;
    width: 55vw;
    max-width: 650px;
    min-width: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
    /* Position character so table covers lower half */
    margin-top: -5vh;
}

.shopkeeper-layer .character-canvas {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.6));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Dialogue box attached to shopkeeper */
.shopkeeper-layer .dialogue-box {
    position: absolute;
    bottom: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: var(--parchment-gradient);
    border: 2px solid var(--wood-medium);
    border-radius: 6px;
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-soft);
    pointer-events: auto;
    z-index: 20;
}

.dialogue-content {
    text-align: center;
}

.dialogue-text {
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.5;
}

.dialogue-indicator {
    position: absolute;
    bottom: 8px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: var(--banner-gold);
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
    animation: bounce 0.8s ease-in-out infinite;
}

/* ===============================================
   TABLE LAYER - Merchant counter/table (IN FRONT of avatar!)
   =============================================== */
.table-layer {
    position: absolute;
    /* Position table to cover avatar's lower half - like a counter */
    top: 52%;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 10;
    transform-style: preserve-3d;
    transform-origin: 50% 0%; /* Tilt from top edge */
    /* Push table FORWARD in 3D space - in front of avatar */
    transform: translateZ(100px);
    /* Note: Transition handled by anime.js for smoother control */
    pointer-events: none; /* Let clicks pass through */
}

/* TABLE TILTS in browse mode - tilts forward to show surface */
.scene-3d.browse-mode .table-layer {
    transform: rotateX(40deg) translateZ(150px); /* Tilt forward, push more forward */
}

.merchant-table {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none; /* Let clicks pass through to children */
}

/* Table front edge - THE COUNTER visible in front view */
.table-edge {
    position: absolute;
    top: 0;
    left: 3%;
    right: 3%;
    height: 80px;
    background: linear-gradient(
        180deg,
        var(--wood-accent) 0%,
        var(--wood-light) 15%,
        var(--wood-medium) 50%,
        var(--wood-dark) 100%
    );
    border-radius: 6px 6px 0 0;
    border: 3px solid var(--wood-accent);
    border-bottom: none;
    box-shadow: 
        0 -8px 30px rgba(0, 0, 0, 0.5),
        inset 0 3px 15px rgba(255, 255, 255, 0.15),
        inset 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 15;
}

/* Wood grain on edge */
.table-edge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 60px,
            rgba(0, 0, 0, 0.04) 60px,
            rgba(0, 0, 0, 0.04) 62px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 20px,
            rgba(255, 255, 255, 0.02) 20px,
            rgba(255, 255, 255, 0.02) 21px
        );
    border-radius: inherit;
}

/* Gold decorative trim on counter edge */
.table-edge::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 40px;
    right: 40px;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--banner-gold) 10%,
        var(--gold-glow) 50%,
        var(--banner-gold) 90%,
        transparent 100%
    );
    opacity: 0.7;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Table top surface - what you see when looking down */
.table-surface {
    position: absolute;
    top: 60px;
    left: 2%;
    right: 2%;
    bottom: 10%;
    background: linear-gradient(
        180deg,
        var(--wood-medium) 0%,
        var(--wood-dark) 100%
    );
    border-radius: 8px;
    border: 3px solid var(--wood-accent);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    pointer-events: none; /* Let clicks pass through to children */
}

/* Wood grain texture */
.table-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 100px,
            rgba(0, 0, 0, 0.03) 100px,
            rgba(0, 0, 0, 0.03) 102px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 150px,
            rgba(255, 255, 255, 0.02) 150px,
            rgba(255, 255, 255, 0.02) 152px
        );
    pointer-events: none;
    z-index: 0;
}

/* Cloth overlay */
.table-cloth {
    position: absolute;
    top: 8%;
    left: 6%;
    right: 6%;
    bottom: 8%;
    background: linear-gradient(
        180deg,
        rgba(30, 45, 58, 0.95) 0%,
        rgba(25, 38, 50, 0.98) 100%
    );
    border-radius: 8px;
    border: 1px solid rgba(74, 155, 140, 0.25);
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2vw 17vw;
    pointer-events: auto;
}

/* Cloth texture */
.table-cloth::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.015) 2px,
        rgba(255, 255, 255, 0.015) 4px
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

/* Custom scrollbar for cloth */
.table-cloth::-webkit-scrollbar {
    width: 8px;
}

.table-cloth::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.table-cloth::-webkit-scrollbar-thumb {
    background: var(--banner-teal);
    border-radius: 4px;
}

.table-cloth::-webkit-scrollbar-thumb:hover {
    background: var(--magic-cyan);
}

/* ===============================================
   FIXED UI LAYER - Stays in place during camera moves
   =============================================== */
.fixed-ui {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.fixed-ui > * {
    pointer-events: auto;
}

/* ===============================================
   HEADER (Fixed UI)
   =============================================== */
.shop-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(
        180deg,
        rgba(20, 12, 8, 0.9) 0%,
        rgba(20, 12, 8, 0.7) 70%,
        transparent 100%
    );
    position: relative;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide header when in browse/table-top mode */
body.browse-mode .shop-header {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--gold-glow);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.3),
        var(--text-shadow);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.header-ornament {
    width: 100px;
    height: 3px;
    background: var(--gold-border);
    position: relative;
}

.header-ornament::before {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-glow);
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.header-ornament.left::before {
    right: -15px;
}

.header-ornament.right::before {
    left: -15px;
}

/* Audio Toggle Button */
.audio-toggle-btn {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border: 2px solid var(--wood-light);
    border-radius: 8px;
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
    z-index: 100;
}

.audio-toggle-btn:hover {
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.audio-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.audio-toggle-btn.muted {
    background: linear-gradient(180deg, var(--banner-red) 0%, #8a4444 100%);
    border-color: #a65353;
}

.audio-icon {
    line-height: 1;
    user-select: none;
}

/* ===============================================
   BROWSE MODE ITEM ANIMATIONS
   =============================================== */
.scene-3d.browse-mode .item-card {
    animation: itemReveal 0.4s ease-out backwards;
}

@keyframes itemReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered delays */
.scene-3d.browse-mode .item-card:nth-child(1) { animation-delay: 0.3s; }
.scene-3d.browse-mode .item-card:nth-child(2) { animation-delay: 0.35s; }
.scene-3d.browse-mode .item-card:nth-child(3) { animation-delay: 0.4s; }
.scene-3d.browse-mode .item-card:nth-child(4) { animation-delay: 0.45s; }
.scene-3d.browse-mode .item-card:nth-child(5) { animation-delay: 0.5s; }
.scene-3d.browse-mode .item-card:nth-child(6) { animation-delay: 0.55s; }
.scene-3d.browse-mode .item-card:nth-child(7) { animation-delay: 0.6s; }
.scene-3d.browse-mode .item-card:nth-child(8) { animation-delay: 0.65s; }

/* Table glow in browse mode */
.scene-3d.browse-mode .table-surface::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 15px;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 215, 0, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    animation: tableGlow 3s ease-in-out infinite alternate;
}

@keyframes tableGlow {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* ===============================================
   SHOP CONTROLS (Fixed UI - Bottom)
   =============================================== */
.shop-controls {
    margin-top: auto;
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(
        0deg,
        rgba(20, 12, 8, 0.95) 0%,
        rgba(30, 20, 12, 0.9) 70%,
        transparent 100%
    );
    backdrop-filter: blur(5px);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ===============================================
   ITEMS GRID - On the table cloth
   =============================================== */

/* Player Stats */
.player-stats {
    display: flex;
    gap: var(--spacing-sm);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid var(--wood-light);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
}

.stat-icon {
    font-size: 1rem;
}

.stat-value {
    color: var(--gold-glow);
    font-weight: 600;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* Shop Categories */
.shop-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.category-btn {
    background: var(--wood-gradient);
    border: 1px solid var(--wood-light);
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Almendra', serif;
    color: var(--parchment);
    font-size: 0.8rem;
}

.category-btn:hover {
    background: var(--wood-light);
    transform: translateY(-1px);
}

.category-btn.active {
    background: linear-gradient(180deg, var(--banner-gold) 0%, #8b6914 100%);
    border-color: var(--gold-glow);
    color: var(--ink);
}

.cat-icon {
    font-size: 1rem;
}

.cat-name {
    font-weight: 600;
}

/* Items Grid - On the table cloth */
.items-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    transform-style: flat; /* Break out of 3D context for proper click handling */
    height: 100%;
}

/* Items container within grid */
.items-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    align-content: start;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0 0;
    pointer-events: auto;
}

.page-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--parchment);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--gold-glow);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
    text-align: center;
}

/* Individual Item Card - Clean minimal design */
.item-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    pointer-events: auto !important;
    transform-style: flat;
    z-index: 5;
    min-width: 0;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 8px 8px 0 0;
    opacity: 0.8;
}

.item-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.item-card:active {
    transform: scale(0.97);
}

.item-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease;
}

.item-card:hover .item-icon {
    transform: scale(1.1);
}

.item-name {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    color: var(--parchment);
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.6rem;
    color: var(--gold-glow);
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

/* Rarity top border colors */
.item-card[data-rarity="common"]::before {
    background: #888;
}

.item-card[data-rarity="uncommon"]::before {
    background: var(--banner-teal);
}

.item-card[data-rarity="rare"]::before {
    background: var(--banner-blue);
}

.item-card[data-rarity="rare"] {
    border-color: rgba(58, 124, 165, 0.3);
}

.item-card[data-rarity="epic"]::before {
    background: var(--banner-purple);
}

.item-card[data-rarity="epic"] {
    border-color: rgba(122, 84, 147, 0.3);
}

.item-card[data-rarity="legendary"]::before {
    background: linear-gradient(90deg, var(--gold-glow), #ff9500, var(--gold-glow));
    height: 4px;
    animation: legendaryShine 2s linear infinite;
}

.item-card[data-rarity="legendary"] {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

@keyframes legendaryShine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

.item-card[data-rarity="legendary"]::before {
    background-size: 200% 100%;
}

/* Shop Actions */
.shop-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.buy-btn {
    background: linear-gradient(180deg, var(--banner-teal) 0%, #3a7a6c 100%);
    border-color: #5fbfac;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.buy-btn:hover {
    background: linear-gradient(180deg, #5fbfac 0%, var(--banner-teal) 100%);
}

.sell-btn {
    background: linear-gradient(180deg, var(--banner-gold) 0%, #a68b1f 100%);
    border-color: #e0c035;
    color: var(--ink);
}

.sell-btn:hover {
    background: linear-gradient(180deg, #e0c035 0%, var(--banner-gold) 100%);
}

.leave-btn {
    background: linear-gradient(180deg, var(--banner-red) 0%, #8a4444 100%);
    border-color: #c96b6b;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.leave-btn:hover {
    background: linear-gradient(180deg, #c96b6b 0%, var(--banner-red) 100%);
}

/* Browse Button - Special styling for table transition */
.browse-btn {
    background: linear-gradient(180deg, var(--banner-purple) 0%, #5a3d6d 100%);
    border-color: #9a6fb3;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.browse-btn:hover {
    background: linear-gradient(180deg, #9a6fb3 0%, var(--banner-purple) 100%);
    box-shadow: 0 0 15px rgba(122, 84, 147, 0.5);
}

.browse-btn.active {
    background: linear-gradient(180deg, var(--banner-teal) 0%, #3a7a6c 100%);
    border-color: var(--magic-cyan);
}

.browse-btn.active span::before {
    content: '↩ ';
}

/* Pulsing glow effect on browse button */
.browse-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent, rgba(122, 84, 147, 0.3), transparent);
    animation: browsePulse 2s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes browsePulse {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

/* ===============================================
   SHOPPING CART PANEL
   =============================================== */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(
        180deg,
        rgba(30, 22, 18, 0.98) 0%,
        rgba(20, 14, 10, 0.98) 100%
    );
    border-left: 3px solid var(--wood-medium);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-panel.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--wood-medium);
    background: linear-gradient(180deg, var(--wood-dark) 0%, transparent 100%);
}

.cart-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold-glow);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cart-icon {
    font-size: 1.3rem;
}

.cart-close-btn {
    background: none;
    border: none;
    color: var(--parchment);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--banner-red);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--parchment-dark);
    text-align: center;
}

.cart-empty .empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 10px;
}

.cart-empty p {
    margin: 4px 0;
    font-family: 'Almendra', serif;
}

.cart-empty .empty-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    border: 2px solid var(--wood-medium);
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    animation: cartItemIn 0.3s ease-out;
}

@keyframes cartItemIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-icon {
    font-size: 1.8rem;
    width: 40px;
    text-align: center;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--wood-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.cart-item-qty button {
    background: none;
    border: none;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.cart-item-qty button:hover {
    background: rgba(0, 0, 0, 0.15);
}

.cart-item-qty span {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--banner-red);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.cart-item:hover .cart-item-remove {
    opacity: 1;
}

/* Cart Footer */
.cart-footer {
    padding: 16px;
    border-top: 2px solid var(--wood-medium);
    background: linear-gradient(0deg, var(--wood-dark) 0%, transparent 100%);
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-family: 'Cinzel', serif;
}

.total-label {
    font-size: 1rem;
    color: var(--parchment);
}

.total-value {
    font-size: 1.3rem;
    color: var(--gold-glow);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(180deg, var(--banner-teal) 0%, #3a7a6c 100%);
    border: 2px solid #5fbfac;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.checkout-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #5fbfac 0%, var(--banner-teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(95, 191, 172, 0.4);
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-cart-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    font-family: 'Almendra', serif;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--wood-medium);
    border-radius: 4px;
    color: var(--parchment-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-cart-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--banner-red);
    border-color: var(--banner-red);
}

/* Cart Toggle Button (floating) */
.cart-toggle-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border: 2px solid var(--gold-glow);
    border-radius: 50%;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.cart-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.3);
}

.cart-btn-icon {
    font-size: 1.4rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--banner-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.cart-count.has-items {
    opacity: 1;
    transform: scale(1);
}

/* Hide cart toggle in browse mode */
body.browse-mode .cart-toggle-btn {
    opacity: 0;
    pointer-events: none;
}

/* ===============================================
   ITEM DETAIL MODAL
   =============================================== */
.item-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.item-modal.open {
    opacity: 1;
    visibility: visible;
}

.item-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.item-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: linear-gradient(
        180deg,
        var(--parchment) 0%,
        var(--parchment-dark) 100%
    );
    border: 4px solid var(--wood-medium);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-modal.open .item-modal-content {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--wood-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--banner-red);
}

.modal-item-display {
    text-align: center;
    margin-bottom: 16px;
}

.modal-item-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: itemFloat 3s ease-in-out infinite;
}

@keyframes itemFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.modal-item-rarity {
    display: inline-block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--wood-medium);
    color: var(--parchment);
}

.modal-item-rarity.common { background: #6b6b6b; }
.modal-item-rarity.uncommon { background: var(--banner-teal); }
.modal-item-rarity.rare { background: var(--banner-blue); }
.modal-item-rarity.epic { background: var(--banner-purple); }
.modal-item-rarity.legendary { 
    background: linear-gradient(90deg, var(--gold-glow) 0%, #ff9500 100%);
    color: var(--ink);
}

.modal-item-info {
    text-align: center;
    margin-bottom: 20px;
}

.modal-item-name {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 8px 0;
}

.modal-item-desc {
    font-family: 'Almendra', serif;
    font-size: 1rem;
    color: var(--wood-dark);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.modal-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.stat-tag {
    font-family: 'Almendra', serif;
    font-size: 0.85rem;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    color: var(--ink);
}

.stat-tag.positive { color: var(--banner-teal); }
.stat-tag.negative { color: var(--banner-red); }

.modal-item-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.modal-item-price {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wood-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-item-price .gold-icon {
    font-size: 1.3rem;
}

.modal-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: var(--wood-medium);
    border: none;
    border-radius: 4px;
    color: var(--parchment);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--wood-dark);
}

.qty-value {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
    color: var(--ink);
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(180deg, var(--banner-purple) 0%, #5a3d6d 100%);
    border: 2px solid #9a6fb3;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.add-to-cart-btn:hover {
    background: linear-gradient(180deg, #9a6fb3 0%, var(--banner-purple) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(122, 84, 147, 0.5);
}

.add-to-cart-btn .btn-icon {
    font-size: 1.2rem;
}

/* Success animation for add to cart */
.add-to-cart-btn.success {
    background: linear-gradient(180deg, var(--banner-teal) 0%, #3a7a6c 100%);
    border-color: #5fbfac;
}


/* ===============================================
   RESPONSIVE DESIGN - Camera Rig System
   =============================================== */

/* Tablet / iPad landscape */
@media (max-width: 1100px) {
    .camera-rig {
        perspective: 1200px;
    }
    
    .shopkeeper-layer .character-container {
        width: 55vw;
        max-width: 550px;
    }
    
    .table-layer {
        top: 50%;
    }
    
    .table-edge {
        height: 70px;
    }
    
    .scene-3d.browse-mode {
        transform: translateY(-28vh) scale(1.35);
    }
    
    .scene-3d.browse-mode .table-layer {
        transform: rotateX(35deg) translateZ(130px);
    }
}

/* iPad portrait */
@media (max-width: 900px) {
    .camera-rig {
        perspective: 1000px;
    }
    
    .shopkeeper-layer .character-container {
        width: 70vw;
        max-width: 500px;
    }
    
    .shopkeeper-layer .dialogue-box {
        width: 280px;
        bottom: 30%;
    }
    
    .table-layer {
        top: 50%;
    }
    
    .table-edge {
        height: 60px;
    }
    
    .items-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .scene-3d.browse-mode {
        transform: translateY(-25vh) scale(1.3);
    }

    .scene-3d.browse-mode .table-layer {
        transform: rotateX(30deg) translateZ(120px);
    }
}

/* Mobile */
@media (max-width: 600px) {
    :root {
        font-size: 13px;
    }
    
    .camera-rig {
        perspective: 800px;
    }
    
    .shop-header {
        padding: 4px var(--spacing-sm);
    }
    
    .shop-title {
        font-size: 1.2rem;
    }
    
    .header-ornament {
        display: none;
    }
    
    .audio-toggle-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.2rem;
        padding: 4px;
    }
    
    .shopkeeper-layer .character-container {
        width: 90vw;
        max-width: 350px;
    }
    
    .shopkeeper-layer .dialogue-box {
        width: 90vw;
        bottom: 25%;
        padding: var(--spacing-xs);
    }
    
    .dialogue-text {
        font-size: 0.9rem;
    }
    
    .table-layer {
        top: 48%;
    }
    
    .table-edge {
        height: 50px;
    }
    
    .table-cloth {
        padding: var(--spacing-sm);
    }
    
    .shop-categories {
        gap: 2px;
    }
    
    .category-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    .cat-name {
        display: none;
    }

    .items-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .page-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .page-info {
        font-size: 0.65rem;
    }

    .item-card {
        padding: 6px 4px;
    }

    .item-icon {
        font-size: 1.2rem;
    }

    .item-name {
        font-size: 0.5rem;
    }

    .item-price {
        font-size: 0.65rem;
    }
    
    .item-icon {
        font-size: 1.5rem;
    }
    
    .item-name {
        font-size: 0.55rem;
    }
    
    .item-price {
        font-size: 0.6rem;
    }
    
    .action-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
    
    .shop-actions {
        gap: 4px;
    }
    
    .player-stats {
        padding: 3px 6px;
        gap: 8px;
    }
    
    .stat-item {
        font-size: 0.75rem;
    }
    
    .stat-icon {
        font-size: 0.85rem;
    }
    
    .scene-3d.browse-mode {
        transform: translateY(-22vh) scale(1.25);
    }
    
    .scene-3d.browse-mode .table-layer {
        transform: rotateX(28deg) translateZ(110px);
    }
    
    /* Cart panel responsive */
    .cart-panel {
        width: 100%;
        max-width: 100vw;
    }
    
    .cart-toggle-btn {
        top: 70px;
        right: 10px;
        width: 44px;
        height: 44px;
    }
    
    .cart-btn-icon {
        font-size: 1.2rem;
    }
    
    /* Modal responsive */
    .item-modal-content {
        width: 95%;
        max-width: 360px;
        padding: 16px;
    }
    
    .modal-item-icon {
        font-size: 3rem;
    }
    
    .modal-item-name {
        font-size: 1.2rem;
    }
    
    .modal-item-desc {
        font-size: 0.9rem;
    }
    
    .modal-item-price {
        font-size: 1.2rem;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
    }
    
    .add-to-cart-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    .shopkeeper-layer .character-container {
        width: 100vw;
    }

    .table-layer {
        top: 48%;
    }

    .table-edge {
        height: 40px;
    }

    .items-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .item-card {
        padding: 5px 3px;
        border-radius: 6px;
    }

    .item-icon {
        font-size: 1rem;
    }

    .item-name {
        font-size: 0.45rem;
    }

    .item-price {
        font-size: 0.5rem;
    }

    .scene-3d.browse-mode {
        transform: translateY(-20vh) scale(1.2);
    }

    .scene-3d.browse-mode .table-layer {
        transform: rotateX(25deg) translateZ(100px);
    }
}

/* ===============================================
   ANIMATIONS & EFFECTS
   =============================================== */

/* Scene entrance animation */
.scene-3d {
    animation: sceneEnter 1s ease-out;
}

@keyframes sceneEnter {
    from {
        opacity: 0;
        transform: translateY(30px) translateZ(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* Fixed UI fade in */
.fixed-ui {
    animation: fadeIn 0.8s ease-out 0.3s backwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Staggered animations for items */
.item-card {
    animation: itemFadeIn 0.4s ease-out backwards;
}

@keyframes itemFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Character state classes */
.character-video.talking {
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5)) brightness(1.05);
}

/* Dialogue typing effect handled by JS */
.dialogue-text.typing::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}
