/* Premium Casino Poker Chips - Photorealistic Design */

/* ============================================
   CHIP BASE - Authentic Clay Casino Chip
   ============================================ */
.chip {
    --chip-size: 48px;
    --chip-primary: #dc143c;
    --chip-secondary: #8b0000;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #ffffff;
    --inlay-bg: #f5f5f5;
    --inlay-border: #cccccc;

    width: var(--chip-size);
    height: var(--chip-size);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    /* Clay composite base with subtle texture */
    background:
        /* Mold marks - decorative ring pattern */
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg 4deg,
            rgba(0, 0, 0, 0.03) 4deg 5deg,
            transparent 5deg 10deg
        ),
        /* Clay texture grain */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"),
        /* Main chip gradient */
        radial-gradient(ellipse 80% 80% at 35% 25%,
            var(--chip-primary) 0%,
            var(--chip-secondary) 100%);

    /* Realistic 3D edge - stacked for thickness */
    box-shadow:
        /* Top bevel - light hitting top edge */
        inset 0 2px 3px rgba(255, 255, 255, 0.25),
        inset 2px 0 3px rgba(255, 255, 255, 0.1),
        /* Bottom edge shadow */
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        inset -2px 0 3px rgba(0, 0, 0, 0.15),
        /* Chip edge thickness layers */
        0 1px 0 0 var(--chip-secondary),
        0 2px 0 0 var(--chip-secondary),
        0 3px 0 0 color-mix(in srgb, var(--chip-secondary) 80%, black),
        0 4px 0 0 color-mix(in srgb, var(--chip-secondary) 60%, black),
        0 5px 1px rgba(0, 0, 0, 0.4),
        /* Drop shadow */
        0 8px 12px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Edge spots - intricate casino chip detailing */
.chip::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    /* Detailed edge pattern with multiple layers */
    background:
        /* Outer notch pattern - ridged edge detail */
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(0, 0, 0, 0.15) 0deg 2deg,
            transparent 2deg 4deg
        ),
        /* Main edge spots - 8 alternating colored rectangles */
        conic-gradient(from 337.5deg at 50% 50%,
            var(--edge-spot-1) 0deg, var(--edge-spot-1) 15deg,
            transparent 15deg, transparent 30deg,
            var(--edge-spot-2) 30deg, var(--edge-spot-2) 45deg,
            transparent 45deg, transparent 67.5deg,
            var(--edge-spot-1) 67.5deg, var(--edge-spot-1) 82.5deg,
            transparent 82.5deg, transparent 97.5deg,
            var(--edge-spot-2) 97.5deg, var(--edge-spot-2) 112.5deg,
            transparent 112.5deg, transparent 135deg,
            var(--edge-spot-1) 135deg, var(--edge-spot-1) 150deg,
            transparent 150deg, transparent 165deg,
            var(--edge-spot-2) 165deg, var(--edge-spot-2) 180deg,
            transparent 180deg, transparent 202.5deg,
            var(--edge-spot-1) 202.5deg, var(--edge-spot-1) 217.5deg,
            transparent 217.5deg, transparent 232.5deg,
            var(--edge-spot-2) 232.5deg, var(--edge-spot-2) 247.5deg,
            transparent 247.5deg, transparent 270deg,
            var(--edge-spot-1) 270deg, var(--edge-spot-1) 285deg,
            transparent 285deg, transparent 300deg,
            var(--edge-spot-2) 300deg, var(--edge-spot-2) 315deg,
            transparent 315deg, transparent 337.5deg
        );
    /* Mask to show only the outer edge ring */
    mask: radial-gradient(circle, transparent 62%, black 65%, black 85%, transparent 88%);
    -webkit-mask: radial-gradient(circle, transparent 62%, black 65%, black 85%, transparent 88%);
    opacity: 0.95;
    pointer-events: none;
}

/* Inner decorative ring */
.chip-inner-ring {
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow:
        inset 0 0 2px rgba(255, 255, 255, 0.3),
        0 0 1px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Center inlay - denomination circle */
.chip::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background:
        /* Inlay shine */
        radial-gradient(ellipse 70% 50% at 35% 30%,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 50%),
        /* Inlay base */
        linear-gradient(180deg,
            var(--inlay-bg) 0%,
            color-mix(in srgb, var(--inlay-bg) 85%, #999) 100%);
    border: 2px solid var(--inlay-border);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Chip value text */
.chip-value {
    position: relative;
    z-index: 5;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: 'Arial Black', 'Helvetica', sans-serif;
    color: var(--chip-secondary);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    letter-spacing: -0.5px;
}

/* Hover effect */
.chip:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.25),
        inset 2px 0 3px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        inset -2px 0 3px rgba(0, 0, 0, 0.15),
        0 1px 0 0 var(--chip-secondary),
        0 2px 0 0 var(--chip-secondary),
        0 3px 0 0 color-mix(in srgb, var(--chip-secondary) 80%, black),
        0 4px 0 0 color-mix(in srgb, var(--chip-secondary) 60%, black),
        0 5px 1px rgba(0, 0, 0, 0.4),
        0 12px 20px rgba(0, 0, 0, 0.5),
        0 6px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   CHIP COLORS - Casino Standard Denominations
   ============================================ */

/* White - $1 */
.chip.white {
    --chip-primary: #f0f0f0;
    --chip-secondary: #d0d0d0;
    --edge-spot-1: #1e90ff;
    --edge-spot-2: #1e90ff;
    --inlay-bg: #ffffff;
    --inlay-border: #cccccc;
}
.chip.white .chip-value {
    color: #333;
}

/* Red - $5 */
.chip.red {
    --chip-primary: #dc143c;
    --chip-secondary: #8b0000;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #ffd700;
    --inlay-bg: #fff8f0;
    --inlay-border: #cc9999;
}
.chip.red .chip-value {
    color: #8b0000;
}

/* Blue - $10 */
.chip.blue {
    --chip-primary: #1e90ff;
    --chip-secondary: #0a4a80;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #ffd700;
    --inlay-bg: #f0f8ff;
    --inlay-border: #8899cc;
}
.chip.blue .chip-value {
    color: #0a4a80;
}

/* Green - $25 */
.chip.green {
    --chip-primary: #228b22;
    --chip-secondary: #0d4d0d;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #ffd700;
    --inlay-bg: #f0fff0;
    --inlay-border: #88aa88;
}
.chip.green .chip-value {
    color: #0d4d0d;
}

/* Purple - $50 */
.chip.purple {
    --chip-primary: #8b008b;
    --chip-secondary: #4a004a;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #ffd700;
    --inlay-bg: #fff0ff;
    --inlay-border: #aa88aa;
}
.chip.purple .chip-value {
    color: #4a004a;
}

/* Black - $100 */
.chip.black {
    --chip-primary: #2a2a2a;
    --chip-secondary: #0a0a0a;
    --edge-spot-1: #ffd700;
    --edge-spot-2: #ffffff;
    --inlay-bg: #1a1a1a;
    --inlay-border: #444444;
}
.chip.black .chip-value {
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.chip.black::after {
    background:
        radial-gradient(ellipse 70% 50% at 35% 30%,
            rgba(255, 215, 0, 0.2) 0%,
            transparent 50%),
        linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

/* Gold - $500 (Premium VIP) */
.chip.gold {
    --chip-primary: #daa520;
    --chip-secondary: #8b6914;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #000000;
    --inlay-bg: linear-gradient(135deg, #fff8dc 0%, #ffd700 50%, #daa520 100%);
    --inlay-border: #8b6914;

    background:
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg 4deg,
            rgba(255, 255, 255, 0.1) 4deg 5deg,
            transparent 5deg 10deg
        ),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"),
        linear-gradient(135deg,
            #ffd700 0%,
            #daa520 25%,
            #b8860b 50%,
            #daa520 75%,
            #ffd700 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 2px 0 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset -2px 0 3px rgba(0, 0, 0, 0.1),
        0 1px 0 0 #b8860b,
        0 2px 0 0 #a67c00,
        0 3px 0 0 #8b6914,
        0 4px 0 0 #6b5210,
        0 5px 1px rgba(0, 0, 0, 0.3),
        0 8px 12px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(255, 215, 0, 0.3);
}
.chip.gold .chip-value {
    color: #4a3000;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.chip.gold::after {
    background:
        radial-gradient(ellipse 70% 50% at 35% 30%,
            rgba(255, 255, 255, 0.5) 0%,
            transparent 50%),
        linear-gradient(135deg, #fffacd 0%, #ffd700 50%, #daa520 100%);
    border-color: #b8860b;
}

/* Orange - $1000 (High Roller) */
.chip.orange {
    --chip-primary: #ff6600;
    --chip-secondary: #cc4400;
    --edge-spot-1: #ffffff;
    --edge-spot-2: #000000;
    --inlay-bg: #fff5e6;
    --inlay-border: #cc6633;
}
.chip.orange .chip-value {
    color: #993300;
}

/* Platinum - $5000 (VIP High Stakes) */
.chip.platinum {
    --chip-primary: #e5e4e2;
    --chip-secondary: #a9a9a9;
    --edge-spot-1: #ffd700;
    --edge-spot-2: #1a1a1a;
    --inlay-bg: linear-gradient(135deg, #f8f8ff 0%, #e5e4e2 50%, #c0c0c0 100%);
    --inlay-border: #888888;

    background:
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg 4deg,
            rgba(255, 255, 255, 0.15) 4deg 5deg,
            transparent 5deg 10deg
        ),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"),
        linear-gradient(135deg,
            #f8f8ff 0%,
            #e5e4e2 20%,
            #c0c0c0 40%,
            #e5e4e2 60%,
            #f8f8ff 80%,
            #e5e4e2 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 2px 0 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset -2px 0 3px rgba(0, 0, 0, 0.1),
        0 1px 0 0 #c0c0c0,
        0 2px 0 0 #a9a9a9,
        0 3px 0 0 #909090,
        0 4px 0 0 #808080,
        0 5px 1px rgba(0, 0, 0, 0.3),
        0 8px 12px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(229, 228, 226, 0.3);
}
.chip.platinum .chip-value {
    color: #2a2a2a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.chip.platinum::after {
    background:
        radial-gradient(ellipse 70% 50% at 35% 30%,
            rgba(255, 255, 255, 0.6) 0%,
            transparent 50%),
        linear-gradient(135deg, #f8f8ff 0%, #e5e4e2 50%, #c0c0c0 100%);
    border-color: #a9a9a9;
}

/* Diamond - $10000 (Vegas Whale) */
.chip.diamond {
    --chip-primary: #b9f2ff;
    --chip-secondary: #4dd0e1;
    --edge-spot-1: #ffd700;
    --edge-spot-2: #ffffff;
    --inlay-bg: linear-gradient(135deg, #e0ffff 0%, #b9f2ff 50%, #87ceeb 100%);
    --inlay-border: #4dd0e1;

    background:
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg 4deg,
            rgba(255, 255, 255, 0.2) 4deg 5deg,
            transparent 5deg 10deg
        ),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E"),
        linear-gradient(135deg,
            #e0ffff 0%,
            #b9f2ff 15%,
            #87ceeb 30%,
            #add8e6 50%,
            #b9f2ff 70%,
            #e0ffff 85%,
            #f0ffff 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 2px 0 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 100, 150, 0.2),
        inset -2px 0 3px rgba(0, 100, 150, 0.1),
        0 1px 0 0 #87ceeb,
        0 2px 0 0 #4dd0e1,
        0 3px 0 0 #26c6da,
        0 4px 0 0 #00bcd4,
        0 5px 1px rgba(0, 0, 0, 0.3),
        0 8px 12px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(185, 242, 255, 0.5),
        0 0 50px rgba(77, 208, 225, 0.3);
}
.chip.diamond .chip-value {
    color: #006064;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.chip.diamond::after {
    background:
        radial-gradient(ellipse 70% 50% at 35% 30%,
            rgba(255, 255, 255, 0.7) 0%,
            transparent 50%),
        linear-gradient(135deg, #e0ffff 0%, #b9f2ff 50%, #87ceeb 100%);
    border-color: #4dd0e1;
}

/* ============================================
   POT CHIPS - 3D Stacked Tower Display
   True vertical stacking with realistic pile
   ============================================ */
#pot-chips {
    min-height: 60px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    transform-style: preserve-3d;
    perspective: 500px;
}

/* Chip stack column - vertical pile */
.chip-tower {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    position: relative;
    transform-style: preserve-3d;
}

.chip-tower .chip {
    --chip-size: 32px;
    margin-bottom: -26px;
    position: relative;
    animation: chipStackIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.chip-tower .chip:first-child {
    margin-bottom: 0;
}

/* Staggered stacking with slight misalignment for realism */
.chip-tower .chip:nth-child(1) { z-index: 1; }
.chip-tower .chip:nth-child(2) { z-index: 2; transform: rotate(12deg); animation-delay: 0.05s; }
.chip-tower .chip:nth-child(3) { z-index: 3; transform: rotate(-8deg); animation-delay: 0.1s; }
.chip-tower .chip:nth-child(4) { z-index: 4; transform: rotate(5deg); animation-delay: 0.15s; }
.chip-tower .chip:nth-child(5) { z-index: 5; transform: rotate(-10deg); animation-delay: 0.2s; }

/* Single chips in pot (fallback horizontal layout) */
#pot-chips > .chip {
    --chip-size: 36px;
    animation: chipDropIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    margin-left: -14px;
    position: relative;
}

#pot-chips > .chip:first-child {
    margin-left: 0;
}

/* Staggered z-index and slight variations for realistic stack look */
#pot-chips > .chip:nth-child(1) { z-index: 8; animation-delay: 0ms; }
#pot-chips > .chip:nth-child(2) { z-index: 7; animation-delay: 50ms; transform: rotate(8deg); }
#pot-chips > .chip:nth-child(3) { z-index: 6; animation-delay: 100ms; transform: rotate(-5deg); }
#pot-chips > .chip:nth-child(4) { z-index: 5; animation-delay: 150ms; transform: rotate(10deg); }
#pot-chips > .chip:nth-child(5) { z-index: 4; animation-delay: 200ms; transform: rotate(-8deg); }
#pot-chips > .chip:nth-child(6) { z-index: 3; animation-delay: 250ms; transform: rotate(6deg); }
#pot-chips > .chip:nth-child(7) { z-index: 2; animation-delay: 300ms; transform: rotate(-10deg); }
#pot-chips > .chip:nth-child(8) { z-index: 1; animation-delay: 350ms; transform: rotate(4deg); }

/* Chip stack-in animation (vertical stacking) */
@keyframes chipStackIn {
    0% {
        transform: translateY(-40px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateY(2px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Chip drop-in animation (horizontal) */
@keyframes chipDropIn {
    0% {
        transform: translateY(-60px) rotate(-90deg) scale(0.6);
        opacity: 0;
    }
    50% {
        transform: translateY(4px) rotate(10deg) scale(1.05);
        opacity: 1;
    }
    75% {
        transform: translateY(-2px) rotate(-3deg) scale(0.98);
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* ============================================
   CHIP STACK - Vertical Stacked Display (for player bets)
   ============================================ */
.chip-stack {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    transform-style: preserve-3d;
}

.chip-stack .chip {
    margin-top: -40px;
}

.chip-stack .chip:first-child {
    margin-top: 0;
}

/* Slight rotation for realism */
.chip-stack .chip:nth-child(2n) { transform: rotate(8deg); }
.chip-stack .chip:nth-child(3n) { transform: rotate(-6deg); }
.chip-stack .chip:nth-child(4n) { transform: rotate(4deg); }
.chip-stack .chip:nth-child(5n) { transform: rotate(-10deg); }

/* Override chip-stack when used with pot-chips */
#pot-chips.chip-stack {
    flex-direction: row;
}

#pot-chips.chip-stack .chip {
    margin-top: 0;
    margin-left: -18px;
}

#pot-chips.chip-stack .chip:first-child {
    margin-left: 0;
}

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

/* Betting animation */
@keyframes chipToss {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.2) translateY(-40px) rotate(180deg);
    }
    100% {
        transform: scale(0.6) translateY(-80px) rotate(360deg);
        opacity: 0;
    }
}

.chip.betting {
    animation: chipToss 0.6s ease-out forwards;
}

/* Winning animation - cascade waterfall effect */
@keyframes chipCascade {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(-20px) translateX(var(--cascade-x, 0)) rotate(45deg) scale(1.1);
        opacity: 1;
    }
    40% {
        transform: translateY(30px) translateX(calc(var(--cascade-x, 0) * 1.5)) rotate(90deg) scale(1);
        opacity: 1;
    }
    60% {
        transform: translateY(80px) translateX(calc(var(--cascade-x, 0) * 2)) rotate(180deg) scale(0.95);
        opacity: 0.9;
    }
    80% {
        transform: translateY(150px) translateX(calc(var(--cascade-x, 0) * 2.5)) rotate(270deg) scale(0.9);
        opacity: 0.7;
    }
    100% {
        transform: translateY(250px) translateX(calc(var(--cascade-x, 0) * 3)) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

/* Chip cascade to winner - each chip gets different X trajectory */
.chip.cascading {
    animation: chipCascade 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.chip.cascading:nth-child(1) { --cascade-x: -30px; animation-delay: 0s; }
.chip.cascading:nth-child(2) { --cascade-x: 25px; animation-delay: 0.05s; }
.chip.cascading:nth-child(3) { --cascade-x: -15px; animation-delay: 0.1s; }
.chip.cascading:nth-child(4) { --cascade-x: 35px; animation-delay: 0.15s; }
.chip.cascading:nth-child(5) { --cascade-x: -25px; animation-delay: 0.2s; }
.chip.cascading:nth-child(6) { --cascade-x: 20px; animation-delay: 0.25s; }
.chip.cascading:nth-child(7) { --cascade-x: -35px; animation-delay: 0.3s; }
.chip.cascading:nth-child(8) { --cascade-x: 30px; animation-delay: 0.35s; }

/* Chips arriving at winner - bounce in from above */
@keyframes chipArrive {
    0% {
        transform: translateY(-100px) rotate(-180deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(8px) rotate(15deg) scale(1.1);
        opacity: 1;
    }
    70% {
        transform: translateY(-4px) rotate(-5deg) scale(0.95);
    }
    85% {
        transform: translateY(2px) rotate(2deg) scale(1.02);
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

.chip.arriving {
    animation: chipArrive 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chip.arriving:nth-child(1) { animation-delay: 0s; }
.chip.arriving:nth-child(2) { animation-delay: 0.06s; }
.chip.arriving:nth-child(3) { animation-delay: 0.12s; }
.chip.arriving:nth-child(4) { animation-delay: 0.18s; }
.chip.arriving:nth-child(5) { animation-delay: 0.24s; }

/* Simple winning bounce */
@keyframes chipWin {
    0% {
        transform: scale(0.5) translateY(-50px) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) translateY(10px) rotate(20deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

.chip.winning {
    animation: chipWin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Pot pulse */
@keyframes potPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.pot-growing {
    animation: potPulse 0.4s ease-out;
}

/* Vegas Jackpot Pot Glow */
@keyframes jackpotGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4))
                drop-shadow(0 0 20px rgba(255, 215, 0, 0.2));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.7))
                drop-shadow(0 0 40px rgba(255, 215, 0, 0.4))
                drop-shadow(0 0 60px rgba(255, 215, 0, 0.2));
    }
}

#pot-chips.jackpot {
    animation: jackpotGlow 1.5s ease-in-out infinite;
}

/* Shine sweep for gold chips */
@keyframes goldShine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

.chip.gold.shining {
    background-image:
        linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 45%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0.3) 55%,
            transparent 100%),
        linear-gradient(135deg, #ffd700 0%, #daa520 25%, #b8860b 50%, #daa520 75%, #ffd700 100%);
    background-size: 200% 100%, 100% 100%;
    animation: goldShine 2s ease-in-out infinite;
}

/* ============================================
   SIZE VARIANTS
   ============================================ */
.chip.small {
    --chip-size: 36px;
}
.chip.small .chip-value {
    font-size: 0.6rem;
}

.chip.large {
    --chip-size: 56px;
}
.chip.large .chip-value {
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .chip {
        --chip-size: 40px;
    }
    .chip .chip-value {
        font-size: 0.65rem;
    }
    #pot-chips {
        max-width: 250px;
        min-height: 50px;
        padding: 6px 10px;
    }
    #pot-chips .chip {
        --chip-size: 36px;
        margin-left: -14px;
    }
}

@media (max-width: 480px) {
    .chip {
        --chip-size: 32px;
    }
    .chip .chip-value {
        font-size: 0.55rem;
    }
    #pot-chips {
        max-width: 200px;
        min-height: 40px;
        padding: 4px 8px;
    }
    #pot-chips .chip {
        --chip-size: 28px;
        margin-left: -12px;
    }
}

@media (max-width: 360px) {
    .chip {
        --chip-size: 26px;
    }
    .chip .chip-value {
        font-size: 0.5rem;
    }
    #pot-chips {
        max-width: 160px;
        min-height: 35px;
    }
    #pot-chips .chip {
        --chip-size: 22px;
        margin-left: -10px;
    }
}
