/* ============================================
   REWARD SCREEN - PREMIUM FANTASY LOOT CARDS
   Consistent with overall game design system
   Enhanced "juicy" animations & premium feel
   ============================================ */

/* 
   Overlay: Dims the main view with atmospheric lighting
   Matches expedition map aesthetic
*/
.reward-screen-overlay {
    position: fixed;
    inset: 0;
    z-index: 3001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);

    /* Dark wood background matching expedition map */
    background: var(--wood-dark);

    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.reward-screen-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Wood table texture background - MATCHING EXPEDITION MAP */
.reward-screen-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url('../img/fantasy_table_bg.png') center/cover,
        radial-gradient(ellipse at center, #2a1a0a 0%, #0f0a05 100%);
    background-blend-mode: overlay;
    opacity: 0.9;
    pointer-events: none;
}

/* Atmospheric lighting - warm lantern glow */
.reward-screen-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 70% at 50% 35%,
            rgba(255, 180, 80, 0.15) 0%,
            rgba(200, 120, 40, 0.08) 35%,
            transparent 65%);
    pointer-events: none;
    animation: ambientPulse 4s ease-in-out infinite;
}

@keyframes ambientPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   HEADER SECTION
   ============================================ */
.reward-header {
    text-align: center;
    margin-bottom: var(--space-6);
    animation: headerReveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(calc(-40px * var(--ui-scale))) scale(calc(0.9 * var(--ui-scale)));
    position: relative;
    z-index: 10;
}

@keyframes headerReveal {
    0% {
        opacity: 0;
        transform: translateY(calc(-40px * var(--ui-scale))) scale(calc(0.9 * var(--ui-scale)));
    }

    60% {
        transform: translateY(calc(5px * var(--ui-scale))) scale(calc(1.02 * var(--ui-scale)));
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(var(--ui-scale));
    }
}

.reward-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
    text-align: center;
    color: transparent;

    /* Premium Gold Gradient - Matching Expedition Map */
    background: linear-gradient(180deg,
            #f0d890 0%,
            #d4a84b 25%,
            #f0d890 45%,
            #d4a84b 55%,
            #a67c30 80%,
            #7a5a20 100%);
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 100% 200%;
    animation: goldShimmer 3s ease-in-out infinite;

    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 168, 75, 0.4);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.7));
}

@keyframes goldShimmer {

    0%,
    100% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 0% 100%;
    }
}

.reward-subtitle {
    font-family: 'IM Fell English', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(212, 168, 75, 0.8);
    margin-top: var(--space-2);
    opacity: 0;
    animation: fadeUp 0.8s ease 0.4s forwards;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
    display: inline-block;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.reward-subtitle::before,
.reward-subtitle::after {
    content: '✦';
    color: var(--gold-ornament);
    margin: 0 var(--space-3);
    font-size: 0.9rem;
    opacity: 0.7;
    animation: starSparkle 2s ease-in-out infinite;
}

.reward-subtitle::after {
    animation-delay: 1s;
}

@keyframes starSparkle {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ============================================
   CARDS CONTAINER
   ============================================ */
.reward-cards-container {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    max-width: 1400px;
    perspective: 2000px;
    padding: var(--space-4);
    position: relative;
    z-index: 5;
}

/* ============================================
   REWARD CARD - PREMIUM LOOT CARD DESIGN
   ============================================ */
.reward-card {
    position: relative;
    width: 300px;
    min-height: 520px;
    display: flex;
    flex-direction: column;

    /* Premium parchment with subtle texture */
    background:
        url('../img/parchment_bg.png') center/cover,
        linear-gradient(175deg,
            #f8f3e8 0%,
            #efe5d5 30%,
            #e8dcc8 70%,
            #ddd0b8 100%);
    background-blend-mode: multiply, normal;

    border-radius: 16px;

    /* Ornate border system */
    border: 4px solid var(--leather);
    box-shadow:
        /* Outer glow for premium feel */
        0 0 0 2px rgba(212, 168, 75, 0.3),
        /* Card depth shadows */
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3),
        /* Inner depth */
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 8px rgba(0, 0, 0, 0.05);

    cursor: pointer;

    /* Smooth transitions */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.3s ease,
        border-color 0.3s ease;

    /* GPU optimization */
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform, box-shadow;

    opacity: 0;
    transform: translateY(100px) rotateX(15deg) scale(0.9);

    animation: dealCard 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;

    overflow: visible;
}

/* Inner ornamental border */
.reward-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(212, 168, 75, 0.4);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Decorative corner flourishes */
.reward-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        /* Top-left corner */
        radial-gradient(circle 20px at 16px 16px, rgba(212, 168, 75, 0.3) 0%, transparent 50%),
        /* Top-right corner */
        radial-gradient(circle 20px at calc(100% - 16px) 16px, rgba(212, 168, 75, 0.3) 0%, transparent 50%),
        /* Bottom-left corner */
        radial-gradient(circle 20px at 16px calc(100% - 16px), rgba(212, 168, 75, 0.3) 0%, transparent 50%),
        /* Bottom-right corner */
        radial-gradient(circle 20px at calc(100% - 16px) calc(100% - 16px), rgba(212, 168, 75, 0.3) 0%, transparent 50%);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes dealCard {
    0% {
        opacity: 0;
        transform: translateY(100px) rotateX(20deg) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translateY(-10px) rotateX(-3deg) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

/* Stagger Animations */
.reward-card:nth-child(1) {
    animation-delay: 0.15s;
}

.reward-card:nth-child(2) {
    animation-delay: 0.3s;
}

.reward-card:nth-child(3) {
    animation-delay: 0.45s;
}

/* Card Glow Effect (for rarity shine) */
.reward-card-glow {
    position: absolute;
    inset: -4px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   HOVER & INTERACTION STATES
   ============================================ */
.reward-card:hover {
    transform: translateY(-25px) scale(1.05) rotateY(2deg);
    border-color: var(--gold-ornament);
    box-shadow:
        0 0 0 3px rgba(212, 168, 75, 0.5),
        0 35px 70px rgba(0, 0, 0, 0.5),
        0 15px 30px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(212, 168, 75, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 100;
}

.reward-card:hover::before {
    border-color: rgba(212, 168, 75, 0.7);
    box-shadow: inset 0 0 20px rgba(212, 168, 75, 0.1);
}

.reward-card:hover::after {
    opacity: 1;
}

.reward-card:hover .reward-card-glow {
    opacity: 0.4;
    background: radial-gradient(ellipse at center,
            rgba(212, 168, 75, 0.3) 0%,
            transparent 70%);
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.5;
    }
}

.reward-card:active {
    transform: translateY(-20px) scale(1.03);
    transition: transform 0.1s ease;
}

/* Selected State */
.reward-card.selected {
    transform: scale(1.08) translateY(-30px);
    border-color: var(--gold-highlight);
    box-shadow:
        0 0 0 4px var(--gold-highlight),
        0 45px 90px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(212, 168, 75, 0.4);
    z-index: 200;
    animation: selectedPulse 0.6s ease forwards;
}

@keyframes selectedPulse {
    0% {
        transform: scale(1.05) translateY(-25px);
    }

    30% {
        transform: scale(1.12) translateY(-35px);
    }

    60% {
        transform: scale(1.06) translateY(-28px);
    }

    100% {
        transform: scale(1.08) translateY(-30px);
    }
}

.reward-card.selected::before {
    border-color: var(--gold-highlight);
    box-shadow: inset 0 0 30px rgba(212, 168, 75, 0.2);
}

.reward-card.selected .reward-card-glow {
    opacity: 0.6;
    background: radial-gradient(ellipse at center,
            rgba(240, 216, 144, 0.5) 0%,
            transparent 60%);
}

.reward-card.not-selected {
    opacity: 0.4;
    transform: scale(0.92) translateY(10px);
    filter: grayscale(0.7) brightness(0.7);
    pointer-events: none;
    transition: all 0.5s ease;
}

/* ============================================
   CARD CONTENT STRUCTURE
   Gestalt Law of Proximity: Related elements grouped together
   GROUP 1: Type Badge (header - separated)
   GROUP 2: Icon + Title (identity cluster - close)
   GROUP 3: Description + Effect (info cluster - close)
   GROUP 4: Rarity Badge (footer - separated)
   ============================================ */
.reward-card-content {
    padding: var(--space-5) var(--space-5) var(--space-4) var(--space-5);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    /* Consistent spacing rhythm */
    gap: 0;
    overflow: hidden;
    /* Contain internal shine effects */
}

/* ============================================
   GROUP 1: HEADER - Type Badge (Wax-Sealed Ribbon)
   Premium fantasy ribbon with atmospheric glow
   ============================================ */
.reward-type-badge {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;

    /* Position and sizing */
    position: relative;
    margin-bottom: var(--space-5);
    padding: 12px 48px;
    min-width: 160px;

    /* Rich velvet/leather ribbon with golden thread */
    background:
        /* Subtle fabric texture */
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px),
        /* Main gradient - deeper and richer */
        linear-gradient(180deg,
            #6a4528 0%,
            #5a3820 15%,
            #4a2a18 40%,
            #3a2010 70%,
            #2a1508 100%);

    /* Warm golden text */
    color: #f0d890;

    /* Ornate golden border with depth */
    border: none;
    border-top: 2px solid #d4a84b;
    border-bottom: 2px solid #8a6830;
    border-radius: 0;

    /* Premium layered shadow with atmospheric glow */
    box-shadow:
        /* Outer golden glow */
        0 0 15px rgba(212, 168, 75, 0.25),
        0 0 30px rgba(212, 168, 75, 0.1),
        /* Depth shadows */
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.5),
        /* Inner lighting */
        inset 0 1px 1px rgba(255, 220, 150, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);

    /* Elegant embossed text */
    text-shadow:
        0 0 12px rgba(240, 216, 144, 0.6),
        0 0 25px rgba(212, 168, 75, 0.4),
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 -1px 0 rgba(255, 220, 150, 0.1);

    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Elegant ribbon shape - softer notches */
    clip-path: polygon(12px 0%,
            calc(100% - 12px) 0%,
            100% 50%,
            calc(100% - 12px) 100%,
            12px 100%,
            0% 50%);
}

/* Golden corner ornaments - larger and more detailed */
.reward-type-badge::before,
.reward-type-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background:
        radial-gradient(circle at 30% 30%, #fff8e0 0%, transparent 40%),
        linear-gradient(145deg, #f0d890 0%, #d4a84b 40%, #a67c30 70%, #7a5a20 100%);
    border-radius: 50%;
    box-shadow:
        0 0 8px rgba(212, 168, 75, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.reward-type-badge::before {
    left: 18px;
}

.reward-type-badge::after {
    right: 18px;
}

/* Enhanced hover state with magical glow */
.reward-card:hover .reward-type-badge {
    transform: translateY(-5px) scale(1.05);
    color: #fff8e0;
    box-shadow:
        0 0 25px rgba(240, 216, 144, 0.5),
        0 0 50px rgba(212, 168, 75, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 5px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 220, 150, 0.25),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);
    text-shadow:
        0 0 15px rgba(255, 240, 200, 0.8),
        0 0 30px rgba(212, 168, 75, 0.6),
        0 1px 0 rgba(0, 0, 0, 0.5);
}

.reward-card:hover .reward-type-badge::before,
.reward-card:hover .reward-type-badge::after {
    box-shadow:
        0 0 12px rgba(240, 216, 144, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   GROUP 2: IDENTITY CLUSTER - Icon + Title
   Wax seal / medallion style icon
   ============================================ */
.reward-icon-wrapper {
    /* Medallion dimensions */
    width: 100px;
    height: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
    flex-shrink: 0;
    position: relative;

    /* Wax seal / wood medallion background */
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 65% 65%, rgba(0, 0, 0, 0.15) 0%, transparent 50%),
        linear-gradient(155deg,
            #7a5a30 0%,
            #6d4e28 25%,
            #5c3d1e 50%,
            #4a3016 75%,
            #3d2815 100%);
    border-radius: 50%;

    /* Premium multi-layer gold rim */
    border: 4px solid #d4a84b;

    /* Layered shadows for depth and premium feel */
    box-shadow:
        /* Gold outer rings */
        0 0 0 2px #a67c30,
        0 0 0 4px rgba(212, 168, 75, 0.3),
        /* Inner beveled effect */
        inset 0 4px 8px rgba(255, 255, 255, 0.15),
        inset 0 -4px 8px rgba(0, 0, 0, 0.35),
        inset 0 0 15px rgba(0, 0, 0, 0.2),
        /* Outer drop shadow */
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.25);

    /* GPU optimization */
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;

    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Inner decorative ring */
.reward-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(212, 168, 75, 0.35);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
}

/* Subtle ambient glow on hover */
.reward-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(212, 168, 75, 0.2) 0%,
            transparent 65%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reward-card:hover .reward-icon-wrapper {
    transform: scale(1.1) rotate(3deg);
    border-color: #f0d890;
    box-shadow:
        0 0 0 2px #d4a84b,
        0 0 0 5px rgba(240, 216, 144, 0.4),
        inset 0 4px 8px rgba(255, 255, 255, 0.2),
        inset 0 -4px 8px rgba(0, 0, 0, 0.3),
        0 12px 30px rgba(0, 0, 0, 0.45),
        0 0 35px rgba(212, 168, 75, 0.25);
}

.reward-card:hover .reward-icon-wrapper::after {
    opacity: 1;
}

/* Icon content styling */
.reward-icon {
    font-size: 2.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 5;
    transition: transform 0.3s ease;
    /* Ensure emoji/images render consistently */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Icon images (if using actual images instead of emoji) */
.reward-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.reward-card:hover .reward-icon {
    transform: scale(1.08);
}

/* Potion Bottle Visuals on Reward Cards (Centralized in style.css or here) */
.reward-potion-bottle {
    width: 80px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-card:hover .reward-potion-bottle {
    transform: scale(1.15) rotate(-3deg);
}

.reward-potion-bottle .potion-bottle-top {
    width: 30px;
    height: 12px;
}

.reward-potion-bottle .potion-bottle-body {
    width: 65px;
    height: 75px;
    border-radius: 8px 8px 20px 20px;
    border-width: 3px;
}

.reward-potion-bottle .potion-liquid {
    border-radius: 0 0 18px 18px;
    /* Slightly more rounded for larger body */
}

/* ============================================
   GRID PATCH VISUALS
   ============================================ */
.reward-grid-visual {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-card:hover .reward-grid-visual {
    transform: scale(1.15) rotate(5deg);
}

.grid-plate {
    width: 80px;
    height: 80px;
    background: #4a4a52;
    border: 3px solid #6a6a72;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.expansion .grid-plate {
    background: #2a1a3a;
    border-color: #5a3a7a;
    box-shadow:
        inset 0 0 20px rgba(120, 80, 200, 0.3),
        0 0 15px rgba(120, 80, 200, 0.2);
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.grid-focus-square {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid #d4a84b;
    background: rgba(212, 168, 75, 0.1);
    box-shadow: 0 0 10px rgba(212, 168, 75, 0.4);
}

.expansion .grid-focus-square {
    border-color: #a070ff;
    background: rgba(160, 112, 255, 0.15);
    box-shadow: 0 0 15px rgba(160, 112, 255, 0.5);
}

/* --- Specific Patch Type Visuals --- */

/* Corner Bonus - 4 corner squares */
.reward-grid-visual.corner_bonus .grid-focus-square {
    width: 20px;
    height: 20px;
    top: 5px;
    left: 5px;
    transform: none;
    background: rgba(212, 168, 75, 0.2);
    box-shadow:
        0 0 10px rgba(212, 168, 75, 0.4),
        /* Shadow-based duplication for other corners */
        65px 0 0 -2px rgba(212, 168, 75, 0.4),
        0 65px 0 -2px rgba(212, 168, 75, 0.4),
        65px 65px 0 -2px rgba(212, 168, 75, 0.4);
}

.reward-grid-visual.corner_bonus .grid-focus-square::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 2px solid #d4a84b;
    box-shadow:
        65px 0 0 -2px #d4a84b,
        0 65px 0 -2px #d4a84b,
        65px 65px 0 -2px #d4a84b;
    border-radius: 2px;
}

/* Center Bonus - Single center square (Refined) */
.reward-grid-visual.center_bonus .grid-focus-square {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.4) 0%, transparent 70%);
    border-width: 3px;
    border-radius: 4px;
}

/* Edge Bonus - Highlight all edges */
.reward-grid-visual.edge_bonus .grid-focus-square {
    width: 90px;
    height: 90px;
    background: none;
    border: 2px dashed #d4a84b;
    box-shadow: inset 0 0 15px rgba(212, 168, 75, 0.2);
    animation: edgePulse 2s ease-in-out infinite;
}

@keyframes edgePulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.95);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

/* Row Bonus - Horizontal band */
.reward-grid-visual.row_bonus .grid-focus-square {
    width: 85px;
    height: 25px;
    border-left: none;
    border-right: none;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.2), transparent);
}

/* Column Bonus - Vertical band */
.reward-grid-visual.column_bonus .grid-focus-square {
    width: 25px;
    height: 85px;
    border-top: none;
    border-bottom: none;
    background: linear-gradient(0deg, transparent, rgba(212, 168, 75, 0.2), transparent);
}

/* Global Bonus - All squares glow */
.reward-grid-visual.global_bonus .grid-focus-square {
    width: 100px;
    height: 100px;
    border: none;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.15) 0%, transparent 70%);
    animation: globalGlow 3s ease-in-out infinite;
}

@keyframes globalGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

/* Type/Color/Tier/Size Bonuses - Use Icons or specific colors */
.reward-grid-visual.type_bonus .grid-focus-square,
.reward-grid-visual.color_bonus .grid-focus-square,
.reward-grid-visual.tier_bonus .grid-focus-square,
.reward-grid-visual.size_bonus .grid-focus-square {
    border-style: double;
    border-width: 4px;
}

.reward-grid-visual.color_bonus .grid-focus-square {
    box-shadow: 0 0 20px rgba(212, 168, 75, 0.4);
}

.reward-grid-visual.color-red .grid-focus-square {
    border-color: #ff4d4d;
    background: rgba(255, 77, 77, 0.2);
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.5);
}

.reward-grid-visual.color-blue .grid-focus-square {
    border-color: #4d94ff;
    background: rgba(77, 148, 255, 0.2);
    box-shadow: 0 0 15px rgba(77, 148, 255, 0.5);
}

.reward-grid-visual.color-green .grid-focus-square {
    border-color: #4dff4d;
    background: rgba(77, 255, 77, 0.2);
    box-shadow: 0 0 15px rgba(77, 255, 77, 0.5);
}

.reward-grid-visual.color-purple .grid-focus-square {
    border-color: #b366ff;
    background: rgba(179, 102, 255, 0.2);
    box-shadow: 0 0 15px rgba(179, 102, 255, 0.5);
}

.reward-grid-visual.color-yellow .grid-focus-square {
    border-color: #ffd633;
    background: rgba(255, 214, 51, 0.2);
    box-shadow: 0 0 15px rgba(255, 214, 51, 0.5);
}

/* --- Expansion Direction Visuals --- */

/* Right Expansion */
.reward-grid-visual.expansion-right .grid-focus-square {
    left: 80%;
    width: 20px;
    height: 80px;
    border-left: 2px dashed #a070ff;
}

/* Bottom Expansion */
.reward-grid-visual.expansion-bottom .grid-focus-square {
    top: 80%;
    width: 80px;
    height: 20px;
    border-top: 2px dashed #a070ff;
}

/* Left Expansion */
.reward-grid-visual.expansion-left .grid-focus-square {
    left: 20%;
    width: 20px;
    height: 80px;
    border-right: 2px dashed #a070ff;
}

/* Top Expansion */
.reward-grid-visual.expansion-top .grid-focus-square {
    top: 20%;
    width: 80px;
    height: 20px;
    border-bottom: 2px dashed #a070ff;
}

/* Double Expansion Overlay */
.reward-grid-visual.expansion-double .grid-focus-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 75%, rgba(160, 112, 255, 0.2) 75%),
        linear-gradient(0deg, transparent 75%, rgba(160, 112, 255, 0.2) 75%);
    border: 2px solid rgba(160, 112, 255, 0.4);
}

.grid-cog {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 45px;
    height: 45px;
    background: #5a5a62;
    border-radius: 50%;
    border: 2px solid #7a7a82;
    animation: constantRotate 8s linear infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.arcane.grid-cog {
    background: #5a3a7a;
    border-color: #8a5a9a;
    box-shadow: 0 0 12px rgba(160, 112, 255, 0.4);
}

.cog-teeth {
    position: absolute;
    inset: -5px;
    border: 6px dotted #5a5a62;
    border-radius: 50%;
}

.arcane .cog-teeth {
    border-color: #5a3a7a;
}

.cog-center {
    position: absolute;
    inset: 30%;
    background: #3a3a42;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes constantRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   CHEST VISUALS
   ============================================ */
.reward-chest-visual {
    width: 110px;
    height: 85px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    /* Contain shimmer effect within chest bounds */
}

.reward-card:hover .reward-chest-visual {
    transform: scale(1.15) translateY(-5px);
}

.chest-lid {
    width: 100px;
    height: 35px;
    background: #5c3d1e;
    border: 3px solid #3d2815;
    border-radius: 12px 12px 4px 4px;
    position: relative;
    margin-bottom: -2px;
    box-shadow: inset 0 4px 8px rgba(255, 255, 255, 0.1);
}

.chest-body {
    width: 100px;
    height: 50px;
    background: #4a3016;
    border: 3px solid #3d2815;
    border-radius: 2px 2px 8px 8px;
    position: relative;
    box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.3);
}

.chest-band {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    background: #a67c30;
    border-left: 1px solid #d4a84b;
    border-right: 1px solid #7a5a20;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.chest-band.left {
    left: 15px;
}

.chest-band.right {
    right: 15px;
}

.chest-lock {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: #d4a84b;
    border: 2px solid #a67c30;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.chest-lock::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: #3d2815;
    border-radius: 2px;
}

/* --- Chest Rarity Variations --- */

/* Uncommon - Silver & Greenish Wood */
.reward-chest-visual.rarity-uncommon .chest-lid {
    background: #4a5a4a;
    border-color: #2a3a2a;
}

.reward-chest-visual.rarity-uncommon .chest-body {
    background: #3a4a3a;
    border-color: #2a3a2a;
}

.reward-chest-visual.rarity-uncommon .chest-band {
    background: #a0a0a0;
    border-left-color: #d0d0d0;
    border-right-color: #707070;
}

.reward-chest-visual.rarity-uncommon .chest-lock {
    background: #d0d0d0;
    border-color: #a0a0a0;
}

/* Rare - Gold & Blue Wood */
.reward-chest-visual.rarity-rare .chest-lid {
    background: #2a355a;
    border-color: #1a254a;
}

.reward-chest-visual.rarity-rare .chest-body {
    background: #1a254a;
    border-color: #0f1835;
}

.reward-chest-visual.rarity-rare .chest-band {
    background: #d4a84b;
    border-left-color: #f0d890;
    border-right-color: #a67c30;
}

.reward-chest-visual.rarity-rare .chest-lock {
    background: #f0d890;
    border-color: #d4a84b;
}

.reward-chest-visual.rarity-rare .chest-glow-aura {
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.25) 0%, transparent 70%);
    animation: chestGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes chestGlow {

    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* --- Chest Badges --- */
.chest-badges {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.chest-tier-badge,
.chest-count-badge {
    background: rgba(0, 0, 0, 0.7);
    color: #f0d890;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    border: 1px solid rgba(212, 168, 75, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.chest-tier-badge {
    color: #90e890;
    /* Greenish for Tier */
}

.chest-count-badge {
    color: #ffcc66;
    /* Goldish for Count */
}

.chest-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(115deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    animation: chestShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes chestShimmer {
    0% {
        left: -100%;
    }

    20%,
    100% {
        left: 100%;
    }
}

/* ============================================
   Title - Elegant handwritten style
   ============================================ */
.reward-card-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 var(--space-4) 0;
    padding: 0 var(--space-2);
    line-height: 1.2;

    /* Rich dark ink */
    color: #2a1a0a;

    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 3px rgba(0, 0, 0, 0.1);

    /* Container for alignment */
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Subtle underline accent */
    position: relative;

    transition: color 0.3s ease;
}

/* Decorative line under title */
.reward-card-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(212, 168, 75, 0.4) 30%,
            rgba(212, 168, 75, 0.5) 50%,
            rgba(212, 168, 75, 0.4) 70%,
            transparent 100%);
}

.reward-card:hover .reward-card-title {
    color: #1a0f05;
}

/* ============================================
   CARD TYPE THEMES - Visual Differentiation
   Each type has its own color palette
   ============================================ */

/* -------------------------------------------
   GRID PATCH - Blue/Steel Theme (Mechanical)
   ------------------------------------------- */
.reward-card-gridPatch .reward-icon-wrapper,
.reward-card-gridPatch:hover .reward-icon-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.reward-card-gridPatch .reward-icon-wrapper::before,
.reward-card-gridPatch .reward-icon-wrapper::after,
.reward-card-gridPatch:hover .reward-icon-wrapper::before,
.reward-card-gridPatch:hover .reward-icon-wrapper::after {
    display: none !important;
}

/* -------------------------------------------
   GRID EXPANSION - Purple/Arcane Theme (Spatial)
   ------------------------------------------- */
.reward-card-gridExpansion .reward-icon-wrapper,
.reward-card-gridExpansion:hover .reward-icon-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.reward-card-gridExpansion .reward-icon-wrapper::before,
.reward-card-gridExpansion .reward-icon-wrapper::after,
.reward-card-gridExpansion:hover .reward-icon-wrapper::before,
.reward-card-gridExpansion:hover .reward-icon-wrapper::after {
    display: none !important;
}

/* -------------------------------------------
   POTION - Clean Icon Style
   ------------------------------------------- */
.reward-card-potion .reward-icon-wrapper,
.reward-card-potion:hover .reward-icon-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.reward-card-potion .reward-icon-wrapper::before,
.reward-card-potion .reward-icon-wrapper::after,
.reward-card-potion:hover .reward-icon-wrapper::before,
.reward-card-potion:hover .reward-icon-wrapper::after {
    display: none !important;
}

/* -------------------------------------------
   EXTRA ITEM - Amber/Gold Theme (Treasure)
   ------------------------------------------- */
.reward-card-extraItem .reward-icon-wrapper,
.reward-card-extraItem:hover .reward-icon-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.reward-card-extraItem .reward-icon-wrapper::before,
.reward-card-extraItem .reward-icon-wrapper::after,
.reward-card-extraItem:hover .reward-icon-wrapper::before,
.reward-card-extraItem:hover .reward-icon-wrapper::after {
    display: none !important;
}

.reward-card-extraItem .reward-card-title::after {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(220, 160, 60, 0.5) 30%,
            rgba(220, 160, 60, 0.6) 50%,
            rgba(220, 160, 60, 0.5) 70%,
            transparent 100%);
}

/* ============================================
   GROUP 3: INFO CLUSTER - Description + Effect
   These belong together ("What does it do?")
   ============================================ */
.reward-card-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ink-brown);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
    /* PROXIMITY: Small gap to effect box (same group) */
    margin: 0 0 var(--space-2) 0;
    opacity: 0.9;
    padding: 0 var(--space-2);

    /* Fixed height for alignment */
    min-height: 4rem;
}

/* Effect Box (part of Info Cluster with Description) */
.reward-card-effect {
    /* PROXIMITY: Pushes to bottom but stays close to description */
    margin-top: var(--space-2);
    width: 100%;

    /* Matching stat capsule design */
    background:
        linear-gradient(175deg,
            #fffef5 0%,
            #f8f4e3 40%,
            #f0ebda 100%);

    /* Realistic paper shadow */
    box-shadow:
        3px 4px 10px rgba(0, 0, 0, 0.12),
        1px 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    border-radius: 6px;
    padding: var(--space-4);
    text-align: center;
    border: none;

    position: relative;
    z-index: 5;

    /* Slight organic rotation */
    transform: rotate(-1deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Tape effect at top */
.reward-card-effect::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(1deg);
    width: 50px;
    height: 14px;
    background: linear-gradient(180deg,
            rgba(210, 195, 165, 0.85) 0%,
            rgba(190, 175, 145, 0.7) 100%);
    border-radius: 2px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.reward-card:hover .reward-card-effect {
    transform: rotate(0deg) scale(1.03);
    box-shadow:
        4px 6px 15px rgba(0, 0, 0, 0.18),
        2px 3px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.effect-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: var(--ink-faded);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.reward-card-effect {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--ink-red);
    text-shadow: none;
    font-weight: 700;
    line-height: 1.4;
}

/* ============================================
   GROUP 4: FOOTER - Rarity Badge
   Separated from info cluster for clear hierarchy
   ============================================ */
.reward-rarity {
    /* PROXIMITY: Large gap above to separate from info cluster */
    margin-top: var(--space-5);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 24px;
    min-width: 130px;

    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;

    background: linear-gradient(145deg, #fff 0%, #f5f0e5 100%);
    border-radius: 25px;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);

    z-index: 10;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.reward-rarity::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transition: left 0.5s ease;
}

.reward-card:hover .reward-rarity::after {
    left: 100%;
}

/* Rarity Variations */
.reward-card.rarity-common .reward-rarity {
    color: #5c3d1e;
    background: linear-gradient(145deg, #f5e6d3 0%, #e6d0b3 100%);
    border: 2px solid #c4a484;
}

.reward-card.rarity-uncommon .reward-rarity {
    color: #2d4d20;
    background: linear-gradient(145deg, #e8f5e0 0%, #cfe6b3 100%);
    border: 2px solid #8ab374;
    box-shadow:
        0 3px 8px rgba(90, 154, 62, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.reward-card.rarity-rare .reward-rarity {
    color: #1a3c6e;
    background: linear-gradient(145deg, #e0ecf5 0%, #b3cfe6 100%);
    border: 2px solid #6494b8;
    box-shadow:
        0 3px 8px rgba(100, 148, 184, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.reward-card.rarity-epic .reward-rarity {
    color: #6e1a4a;
    background: linear-gradient(145deg, #f5e0f0 0%, #e6b3d5 100%);
    border: 2px solid #b874a8;
    box-shadow:
        0 3px 8px rgba(184, 116, 168, 0.25),
        0 0 15px rgba(184, 116, 168, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.reward-card.rarity-legendary .reward-rarity {
    color: #8a6d1c;
    background: linear-gradient(145deg, #faf0d5 0%, #e6dab3 100%);
    border: 2px solid #d4a84b;
    box-shadow:
        0 4px 12px rgba(212, 168, 75, 0.35),
        0 0 20px rgba(212, 168, 75, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {

    0%,
    100% {
        box-shadow:
            0 4px 12px rgba(212, 168, 75, 0.35),
            0 0 20px rgba(212, 168, 75, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    50% {
        box-shadow:
            0 4px 12px rgba(212, 168, 75, 0.5),
            0 0 35px rgba(212, 168, 75, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 1);
    }
}

/* Hover Effect for Badge */
.reward-card:hover .reward-rarity {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   REWARD TYPE SPECIFIC STYLES - UNIQUE SHAPES
   Each type has a distinctive silhouette
   ============================================ */


/* ============================================
   FOOTER HINT
   ============================================ */
.reward-footer {
    margin-top: var(--space-8);
    opacity: 0;
    animation: fadeIn 1s ease 1.2s forwards;
    text-align: center;
    position: relative;
    z-index: 10;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.reward-hint {
    font-family: 'IM Fell English', serif;
    font-size: 1.15rem;
    color: rgba(212, 168, 75, 0.75);
    font-style: italic;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   CONFIRMATION MODAL - LEGENDARY TREASURE REVEAL
   Premium, juicy, and atmospheric celebration
   ============================================ */
.reward-confirmation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(calc(0.5 * var(--ui-scale))) rotateX(25deg);
    opacity: 0;

    width: 520px;
    padding: var(--space-8) var(--space-6);

    /* Rich parchment with aged texture */
    background:
        url('../img/parchment_bg.png') center/cover,
        linear-gradient(175deg,
            #faf6ed 0%,
            #f3ead8 20%,
            #ebe0c8 50%,
            #e0d4b8 80%,
            #d5c8a5 100%);
    background-blend-mode: multiply, normal;

    /* Ornate layered border system */
    /* Border removed to avoid squared edges on rounded corners */
    border: none;
    border-radius: 20px;

    /* Epic premium shadows with golden glow */
    box-shadow:
        /* Outer golden aura */
        0 0 0 3px rgba(212, 168, 75, 0.6),
        0 0 0 6px rgba(139, 105, 20, 0.3),
        /* Dramatic depth */
        0 40px 100px rgba(0, 0, 0, 0.8),
        0 20px 50px rgba(0, 0, 0, 0.6),
        /* Magical golden radiance */
        0 0 120px rgba(212, 168, 75, 0.4),
        0 0 200px rgba(212, 168, 75, 0.2);

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-5);

    pointer-events: none;
    z-index: 4000;

    /* Slight levitation effect */
    filter: drop-shadow(0 0 40px rgba(255, 200, 100, 0.3));
}

/* Ornate inner frame with golden filigree effect */
.reward-confirmation::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px solid rgba(212, 168, 75, 0.5);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
    box-shadow:
        inset 0 0 30px rgba(212, 168, 75, 0.1),
        0 0 20px rgba(212, 168, 75, 0.15);
    animation: innerFrameShimmer 3s ease-in-out infinite;
}

@keyframes innerFrameShimmer {

    0%,
    100% {
        border-color: rgba(212, 168, 75, 0.4);
        box-shadow:
            inset 0 0 30px rgba(212, 168, 75, 0.1),
            0 0 20px rgba(212, 168, 75, 0.1);
    }

    50% {
        border-color: rgba(240, 216, 144, 0.7);
        box-shadow:
            inset 0 0 40px rgba(212, 168, 75, 0.2),
            0 0 30px rgba(212, 168, 75, 0.25);
    }
}

/* Magical corner embellishments with animated sparkle */
.reward-confirmation::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    border-radius: 20px;
    background:
        /* Top corners - larger ornate flourishes */
        radial-gradient(circle 35px at 25px 25px, rgba(240, 216, 144, 0.6) 0%, rgba(212, 168, 75, 0.3) 30%, transparent 60%),
        radial-gradient(circle 35px at calc(100% - 25px) 25px, rgba(240, 216, 144, 0.6) 0%, rgba(212, 168, 75, 0.3) 30%, transparent 60%),
        /* Bottom corners */
        radial-gradient(circle 35px at 25px calc(100% - 25px), rgba(240, 216, 144, 0.6) 0%, rgba(212, 168, 75, 0.3) 30%, transparent 60%),
        radial-gradient(circle 35px at calc(100% - 25px) calc(100% - 25px), rgba(240, 216, 144, 0.6) 0%, rgba(212, 168, 75, 0.3) 30%, transparent 60%),
        /* Wax seal accents at top center */
        radial-gradient(circle 15px at 50% 8px, rgba(139, 69, 19, 0.4) 0%, transparent 70%);
    animation: cornerSparkle 2s ease-in-out infinite;
}

@keyframes cornerSparkle {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Epic reveal animation with bounce and glow burst */
.reward-confirmation.active {
    animation: legendaryReveal 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}

@keyframes legendaryReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(calc(0.4 * var(--ui-scale))) rotateX(30deg) rotateY(-5deg);
        filter: brightness(2) drop-shadow(0 0 60px rgba(255, 215, 0, 0.8));
    }

    30% {
        opacity: 1;
        filter: brightness(1.5) drop-shadow(0 0 80px rgba(255, 215, 0, 0.6));
    }

    50% {
        transform: translate(-50%, -50%) scale(calc(1.08 * var(--ui-scale))) rotateX(-5deg) rotateY(2deg);
    }

    70% {
        transform: translate(-50%, -50%) scale(calc(0.98 * var(--ui-scale))) rotateX(2deg);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(var(--ui-scale)) rotateX(0) rotateY(0);
        filter: drop-shadow(0 0 40px rgba(255, 200, 100, 0.3));
    }
}

/* Floating particles container (simulated with box-shadows) */
.reward-confirmation.active::before {
    animation: innerFrameShimmer 3s ease-in-out infinite,
        celebrationBurst 0.8s ease-out forwards;
}

@keyframes celebrationBurst {
    0% {
        box-shadow:
            inset 0 0 60px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(255, 215, 0, 0.5);
    }

    100% {
        box-shadow:
            inset 0 0 30px rgba(212, 168, 75, 0.1),
            0 0 20px rgba(212, 168, 75, 0.15);
    }
}

/* ============================================
   CONFIRMATION ICON - CIRCULAR MEDALLION
   ============================================ */
.confirmation-icon {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    position: relative;
    z-index: 10;

    /* No background - just a container for the icon */
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;

    /* Icon floats freely */
    animation: legendaryIconFloat 3s ease-in-out infinite;
}

/* When showing detailed icons, make container background transparent */
.confirmation-icon:has(.reward-grid-visual),
.confirmation-icon:has(.reward-chest-visual),
.confirmation-icon:has(.confirmation-potion-bottle) {
    background: none;
    border: none;
    box-shadow: none;
}

.confirmation-icon:has(.reward-grid-visual)::before,
.confirmation-icon:has(.reward-chest-visual)::before,
.confirmation-icon:has(.confirmation-potion-bottle)::before,
.confirmation-icon:has(.reward-grid-visual)::after,
.confirmation-icon:has(.reward-chest-visual)::after,
.confirmation-icon:has(.confirmation-potion-bottle)::after {
    display: none;
}

/* Confirmation modal potion bottle sizing */
.confirmation-potion-bottle {
    width: 100px;
    height: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
    animation: confirmationIconBounce 2s ease-in-out infinite;
}

.confirmation-potion-bottle .potion-bottle-top {
    width: 38px;
    height: 15px;
}

.confirmation-potion-bottle .potion-bottle-body {
    width: 82px;
    height: 95px;
    border-radius: 10px 10px 25px 25px;
    border-width: 3px;
}

.confirmation-potion-bottle .potion-liquid {
    border-radius: 0 0 22px 22px;
}

/* Confirmation modal grid visual sizing */
.confirmation-icon .reward-grid-visual {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
    animation: confirmationIconBounce 2s ease-in-out infinite;
}

.confirmation-icon .reward-grid-visual .grid-plate {
    width: 100px;
    height: 100px;
}

.confirmation-icon .reward-grid-visual .grid-cog {
    width: 55px;
    height: 55px;
}

/* Confirmation modal chest visual sizing */
.confirmation-icon .reward-chest-visual {
    width: 130px;
    height: 100px;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
    animation: confirmationIconBounce 2s ease-in-out infinite;
}

.confirmation-icon .reward-chest-visual .chest-lid {
    width: 120px;
    height: 42px;
}

.confirmation-icon .reward-chest-visual .chest-body {
    width: 120px;
    height: 60px;
}

/* Bounce animation for confirmation icons */
@keyframes confirmationIconBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

/* Fallback emoji styling */
.confirmation-emoji {
    font-size: 4.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* No pseudo-elements for confirmation-icon - icons are self-contained */
.confirmation-icon::before,
.confirmation-icon::after {
    display: none;
}

@keyframes legendaryIconFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

/* ============================================
   CONFIRMATION TEXT - ROYAL PROCLAMATION
   ============================================ */
.confirmation-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 5;
    padding: 0 var(--space-4);
}

/* "Reward Claimed!" - Triumphant header with solid gold color */
.confirmation-text h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    margin: 0;
    padding: var(--space-2) var(--space-5);
    position: relative;

    /* Solid readable gold color */
    color: #8b6914;

    /* Strong text shadow for depth and glow */
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(212, 168, 75, 0.4);

    /* Gold underline accent */
    border-bottom: 2px solid rgba(212, 168, 75, 0.6);
    padding-bottom: var(--space-2);
}

/* Text shimmer animation - kept for potential future use */

/* Decorative lines around header */
.confirmation-text h2::before,
.confirmation-text h2::after {
    content: '⚜';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--gold-ornament);
    opacity: 0.7;
    animation: ornamentPulse 2s ease-in-out infinite;
}

.confirmation-text h2::before {
    left: -25px;
}

.confirmation-text h2::after {
    right: -25px;
    animation-delay: 1s;
}

@keyframes ornamentPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Item Name - Legendary Title with strong contrast */
.confirmation-text p {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.2rem;
    line-height: 1.25;
    font-style: normal;
    margin: 0;
    padding: var(--space-3) 0;
    position: relative;

    /* Rich dark brown ink - high contrast on parchment */
    color: #2a1a0a;

    /* Strong layered text shadow for depth and premium feel */
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(212, 168, 75, 0.15);

    animation: titleReveal 0.8s ease-out 0.3s both;
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(calc(20px * var(--ui-scale))) scale(calc(0.9 * var(--ui-scale)));
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(var(--ui-scale));
        filter: blur(0);
    }
}

/* Decorative divider below title */
.confirmation-text p::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(212, 168, 75, 0.6) 20%,
            rgba(212, 168, 75, 0.8) 50%,
            rgba(212, 168, 75, 0.6) 80%,
            transparent 100%);
    animation: dividerFade 1s ease-out 0.5s both;
}

@keyframes dividerFade {
    0% {
        width: 0%;
        opacity: 0;
    }

    100% {
        width: 60%;
        opacity: 1;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
    .reward-cards-container {
        gap: var(--space-4);
    }

    .reward-card {
        width: 280px;
        min-height: 480px;
    }

    .reward-icon-wrapper {
        width: 95px;
        height: 95px;
    }

    .reward-icon {
        font-size: 3.2rem;
    }

    .reward-card-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 900px) {
    .reward-cards-container {
        flex-direction: column;
        gap: var(--space-5);
    }

    .reward-card {
        width: 100%;
        max-width: 380px;
        min-height: auto;
    }

    .reward-card:hover {
        transform: translateY(-15px) scale(1.02);
    }

    .reward-title {
        font-size: 2rem;
    }
}

@media (max-width: 500px) {
    .reward-confirmation {
        width: 90%;
        padding: var(--space-4);
    }

    .confirmation-icon {
        width: 100px;
        height: 100px;
        font-size: 3.5rem;
    }

    .confirmation-text p {
        font-size: 1.6rem;
    }
}

/* ============================================
   CLOSING ANIMATION
   ============================================ */
.reward-screen-overlay.closing {
    animation: overlayClose 0.5s ease forwards;
}

@keyframes overlayClose {
    to {
        opacity: 0;
        transform: scale(1.05);
    }
}

.reward-screen-overlay.closing .reward-card {
    animation: cardFlyAway 0.5s ease forwards;
}

@keyframes cardFlyAway {
    to {
        opacity: 0;
        transform: translateY(-100px) scale(0.8) rotateX(-20deg);
    }
}

/* ============================================
   HIDE UI ELEMENTS DURING REWARD SCREEN
   ============================================ */
.reward-screen-overlay.active~#btn-restart,
.reward-screen-overlay.active~* #btn-restart,
body:has(.reward-screen-overlay.active) #btn-restart {
    display: none !important;
}