/* ═══════════════════════════════════════════════
   Randomiser Suite — Global Styles
   ═══════════════════════════════════════════════ */

/* ── Base Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

input[type="text"], input[type="number"], textarea, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ── Navigation Active State ── */
.nav-btn.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.08);
}
.nav-btn.active .nav-icon {
    color: rgb(129, 140, 248);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}
.nav-btn.disabled {
    pointer-events: none;
    opacity: 0.35;
}

/* ── Module Container Transitions ── */
#module-container {
    position: relative;
}
.module-view {
    height: 100%;
    position: relative;
    animation: moduleEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes moduleEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.module-exit {
    animation: moduleExit 0.2s ease-in forwards;
}
@keyframes moduleExit {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}

/* ── Module Common Layout ── */
.module-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
    gap: 1.5rem;
}
.module-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    text-align: center;
}
.module-subtitle {
    font-size: 0.8rem;
    color: rgb(148, 163, 184);
    text-align: center;
    max-width: 400px;
}

/* ── Action Button ── */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, rgb(99, 102, 241), rgb(139, 92, 246));
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}
.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}
.action-btn.disabled, .action-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}
.action-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
}
.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}
.action-btn.danger {
    background: linear-gradient(135deg, rgb(239, 68, 68), rgb(220, 38, 38));
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

/* ── Control inputs ── */
.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}
.control-label {
    font-size: 0.8rem;
    color: rgb(148, 163, 184);
    font-weight: 500;
}
.control-select, .control-input {
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    min-width: 60px;
}
.control-select:focus, .control-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.control-select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    cursor: pointer;
}

/* ── Toggle Switch ── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #94a3b8;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
input:checked + .toggle-slider {
    background-color: #4f46e5;
    border-color: #6366f1;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

/* ── Result display ── */
.result-display {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Glass card ── */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* ── History item ── */
.history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    color: rgb(148, 163, 184);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    animation: historySlide 0.3s ease-out;
    line-height: 1.4;
}
.history-item .history-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-top: 1px;
}
@keyframes historySlide {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════
   DICE MODULE
   ═══════════════════════════════════════════════ */
.dice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}
.die {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    position: relative;
    transition: all 0.3s;
}
.die.rolling {
    animation: diceShake 0.12s infinite alternate;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}
.die.resolved {
    animation: diceResolve 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}
@keyframes diceShake {
    0%   { transform: translate(-3px, -2px) rotate(-8deg) scale(1.05); }
    25%  { transform: translate(2px, 3px) rotate(6deg) scale(0.95); }
    50%  { transform: translate(-2px, 1px) rotate(-4deg) scale(1.02); }
    75%  { transform: translate(3px, -1px) rotate(10deg) scale(0.97); }
    100% { transform: translate(1px, 2px) rotate(-6deg) scale(1.03); }
}
@keyframes diceResolve {
    0%   { transform: scale(1.3) rotate(10deg); }
    50%  { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.die.dots {
    display: grid;
    grid-template-areas:
        "a . c"
        "e g f"
        "d . b";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    padding: 10px;
    gap: 2px;
}
.pip {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fff;
    align-self: center;
    justify-self: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.pip[data-pos="center"] { grid-area: g; }
.pip[data-pos="top-left"] { grid-area: a; }
.pip[data-pos="bottom-right"] { grid-area: b; }
.pip[data-pos="top-right"] { grid-area: c; }
.pip[data-pos="bottom-left"] { grid-area: d; }
.pip[data-pos="middle-left"] { grid-area: e; }
.pip[data-pos="middle-right"] { grid-area: f; }
@media (max-width: 1023px) {
    .die.dots { padding: 8px; }
    .pip { width: 10px; height: 10px; }
}

/* ═══════════════════════════════════════════════
   COIN MODULE
   ═══════════════════════════════════════════════ */
.coin-scene {
    perspective: 800px;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}
.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}
.coin.flipping {
    animation: coinFlip 2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    backface-visibility: hidden;
    border: 3px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    padding: 1rem;
    word-break: break-word;
}
.coin-face.side-a {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.coin-face.side-b {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    transform: rotateY(180deg);
}
@keyframes coinFlip {
    0%   { transform: rotateY(0deg) rotateX(0deg); }
    20%  { transform: rotateY(720deg) rotateX(180deg); }
    40%  { transform: rotateY(1440deg) rotateX(0deg); }
    60%  { transform: rotateY(2160deg) rotateX(90deg); }
    80%  { transform: rotateY(2700deg) rotateX(30deg); }
    100% { transform: rotateY(var(--final-rotation)) rotateX(0deg); }
}

/* ═══════════════════════════════════════════════
   LADDER MODULE
   ═══════════════════════════════════════════════ */
.ladder-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.ladder-canvas-wrapper canvas {
    display: block;
    width: 100%;
}
.ladder-cover {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.ladder-cover.hidden {
    opacity: 0;
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════
   WHEEL MODULE
   ═══════════════════════════════════════════════ */
.wheel-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wheel-canvas {
    border-radius: 50%;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.15));
    transition: filter 0.3s;
}
.wheel-canvas.spinning {
    filter: drop-shadow(0 0 50px rgba(99, 102, 241, 0.3));
}
.wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.wheel-centre-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 3px solid rgba(255, 255, 255, 0.2);
    z-index: 5;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════
   ROULETTE (BALLOON) MODULE
   ═══════════════════════════════════════════════ */
.balloon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.balloon {
    width: 120px;
    height: 150px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    transition: transform 0.3s, filter 0.3s;
    box-shadow: inset -15px -10px 30px rgba(0, 0, 0, 0.2),
                inset 8px 8px 20px rgba(255, 255, 255, 0.15),
                0 0 40px rgba(239, 68, 68, 0.2);
}
.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 16px solid #dc2626;
}
.balloon.inflating {
    animation: balloonShake 0.15s infinite alternate;
}
@keyframes balloonShake {
    0%   { transform: translate(-1px, -1px) rotate(-1deg); }
    50%  { transform: translate(1px, 1px) rotate(0.5deg); }
    100% { transform: translate(-1px, 0px) rotate(1deg); }
}
.balloon.popped {
    animation: balloonPop 0.3s ease-out forwards;
}
@keyframes balloonPop {
    0%   { transform: scale(1); opacity: 1; }
    30%  { transform: scale(1.4); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}
/* Pop particle burst */
.pop-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleBurst 0.8s ease-out forwards;
    pointer-events: none;
}
@keyframes particleBurst {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}
/* Pop flash overlay */
.pop-flash {
    position: fixed;
    inset: 0;
    background: rgba(239, 68, 68, 0.15);
    z-index: 100;
    pointer-events: none;
    animation: flashFade 0.5s ease-out forwards;
}
@keyframes flashFade {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ═══════════════════════════════════════════════
   LOTS MODULE
   ═══════════════════════════════════════════════ */
.lots-bundle {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}
.lot-stick {
    background: linear-gradient(180deg, #d97706, #b45309);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px 6px 3px 3px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s, border-color 0.4s, box-shadow 0.4s;
    position: relative;
    height: 120px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transform: rotate(var(--rot, 0deg)) translateY(0);
    transform-origin: bottom center;
}
.lot-stick:hover:not(.drawn) {
    transform: rotate(var(--rot, 0deg)) translateY(-20px);
    border-color: #fbbf24;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}
.lot-stick.drawn {
    cursor: default;
    z-index: 10;
}
.lot-stick.drawn.penalty {
    animation: lotRevealPenalty 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.lot-stick.drawn.safe {
    animation: lotRevealSafe 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes lotRevealPenalty {
    0%   { transform: rotate(var(--rot, 0deg)) translateY(0); }
    100% { transform: rotate(var(--rot, 0deg)) translateY(-80px); background: linear-gradient(180deg, #ef4444, #dc2626); border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 25px rgba(239, 68, 68, 0.4); }
}
@keyframes lotRevealSafe {
    0%   { transform: rotate(var(--rot, 0deg)) translateY(0); }
    100% { transform: rotate(var(--rot, 0deg)) translateY(-80px); background: linear-gradient(180deg, #22c55e, #16a34a); border-color: rgba(34, 197, 94, 0.6); box-shadow: 0 0 25px rgba(34, 197, 94, 0.3); }
}

/* Cup Rumble & Pulse animations for haptic visual feedback */
@keyframes cupRumblePenalty {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.lots-cup-wrapper.rumble-penalty {
    animation: cupRumblePenalty 0.4s ease-in-out;
}
.lots-cup-wrapper.rumble-penalty .lots-cup {
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.6), inset 0 2px 10px rgba(255,255,255,0.05) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

@keyframes cupPulseSafe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
.lots-cup-wrapper.pulse-safe {
    animation: cupPulseSafe 0.4s ease-in-out;
}
.lots-cup-wrapper.pulse-safe .lots-cup {
    box-shadow: 0 0 35px rgba(34, 197, 94, 0.5), inset 0 2px 10px rgba(255,255,255,0.05) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
}

/* ═══════════════════════════════════════════════
   FINGER ROULETTE MODULE
   ═══════════════════════════════════════════════ */
.finger-canvas {
    position: absolute;
    inset: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.finger-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: fingerPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.1);
}
.finger-ring.winner {
    border-color: #fbbf24;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.4), inset 0 0 30px rgba(251, 191, 36, 0.15);
    animation: fingerWin 0.5s ease-in-out infinite alternate;
}
@keyframes fingerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}
@keyframes fingerWin {
    0%   { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.25); border-width: 5px; }
}
.finger-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 5;
    animation: countdownPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes countdownPop {
    0%   { transform: translate(-50%, -50%) scale(2); opacity: 0; }
    50%  { transform: translate(-50%, -50%) scale(0.9); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
}

/* ═══════════════════════════════════════════════
   SLOT MACHINE MODULE
   ═══════════════════════════════════════════════ */
.slot-machine {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(30, 27, 75, 0.4));
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}
.slot-machine::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center top, rgba(99, 102, 241, 0.05), transparent 70%);
    pointer-events: none;
}
.slot-reels {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}
.slot-reel-window {
    width: 90px;
    height: 100px;
    overflow: hidden;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}
.slot-reel-window::before,
.slot-reel-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30%;
    z-index: 2;
    pointer-events: none;
}
.slot-reel-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), transparent);
}
.slot-reel-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
}
.slot-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s;
}
.slot-reel.spinning {
    filter: blur(2px);
}
.slot-reel.resolved {
    filter: blur(0);
    transition: filter 0.2s;
}
.slot-symbol {
    width: 90px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}
.slot-lever {
    width: 50px;
    height: 120px;
    position: relative;
    margin-left: 1rem;
    cursor: pointer;
}
.slot-lever-track {
    position: absolute;
    left: 50%;
    top: 10px;
    bottom: 10px;
    width: 8px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.slot-lever-handle {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: grab;
    transition: top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.slot-lever-handle.pulled {
    top: calc(100% - 40px);
}
.slot-jackpot {
    animation: jackpotFlash 0.5s ease-in-out 3;
}
@keyframes jackpotFlash {
    0%, 100% { box-shadow: 0 0 60px rgba(99, 102, 241, 0.1); }
    50%      { box-shadow: 0 0 80px rgba(251, 191, 36, 0.4), 0 0 120px rgba(251, 191, 36, 0.2); border-color: rgba(251, 191, 36, 0.5); }
}

/* ═══════════════════════════════════════════════
   WELCOME SCREEN
   ═══════════════════════════════════════════════ */
.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 640px;
}
.welcome-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.welcome-card:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.welcome-card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.welcome-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(148, 163, 184);
}

/* ═══════════════════════════════════════════════
   TAG CHIPS (for items list)
   ═══════════════════════════════════════════════ */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: rgb(203, 213, 225);
}
.tag-chip-remove {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    color: rgb(148, 163, 184);
    transition: background 0.15s;
}
.tag-chip-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* ═══════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════ */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.1); }
    50%      { box-shadow: 0 0 40px rgba(99, 102, 241, 0.25); }
}

/* ── Responsive ── */
@media (max-width: 1023px) {
    .module-wrapper {
        padding: 1.25rem;
        padding-top: 0.5rem;
        justify-content: flex-start;
    }
    .die {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
        border-radius: 12px;
    }
    .coin-scene {
        width: 140px;
        height: 140px;
    }
    .result-display {
        font-size: 2rem;
    }
}

/* ═══════════════════════════════════════════════
   BLACKJACK MODULE
   ═══════════════════════════════════════════════ */
.blackjack-table {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    width: 100%;
}
.hand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 140px;
}
.hand-cards {
    display: flex;
    gap: -40px; /* Overlap cards */
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.5rem;
}
.playing-card {
    width: 80px;
    height: 112px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: -2px 4px 10px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-right: -40px; /* Card overlap */
    animation: cardDeal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.playing-card:last-child {
    margin-right: 0;
}
.playing-card:hover {
    transform: translateY(-10px) rotate(-2deg);
    z-index: 10;
}
@keyframes cardDeal {
    0% { transform: translateY(-50px) rotate(15deg) scale(0.8); opacity: 0; }
    100% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}
.playing-card.red { color: #ef4444; }
.playing-card.black { color: #0f172a; }
.card-top-left { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card-bottom-right { display: flex; flex-direction: column; align-items: center; line-height: 1; transform: rotate(180deg); }
.card-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; opacity: 0.2; }
.card-back { background: repeating-linear-gradient(45deg, #1e1b4b, #1e1b4b 10px, #312e81 10px, #312e81 20px); border: 2px solid #fff; color: transparent; }
.card-back .card-top-left, .card-back .card-bottom-right, .card-back .card-center { display: none; }
.hand-score {
    background: rgba(0,0,0,0.5);
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Card Shuffle Animations */
@keyframes shuffleCard-0 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); z-index: 1; }
    50% { transform: translate(-30px, -5px) rotate(-8deg); z-index: 5; }
}
@keyframes shuffleCard-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); z-index: 2; }
    50% { transform: translate(30px, 5px) rotate(8deg); z-index: 4; }
}
@keyframes shuffleCard-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); z-index: 3; }
    50% { transform: translate(-15px, 8px) rotate(-4deg); z-index: 3; }
}
@keyframes shuffleCard-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); z-index: 4; }
    50% { transform: translate(15px, -8px) rotate(4deg); z-index: 2; }
}
@keyframes shuffleCard-4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); z-index: 5; }
    50% { transform: translate(0, -12px) rotate(0deg); z-index: 1; }
}

/* ═══════════════════════════════════════════════
   MAGIC 8-BALL & TAROT CARDS
   ═══════════════════════════════════════════════ */
.eightball-sphere {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4b5563, #1f2937, #090d16);
    box-shadow: inset -10px -10px 40px rgba(0,0,0,0.8), 10px 10px 30px rgba(0,0,0,0.5), 0 0 40px rgba(99,102,241,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.1s ease;
}
.eightball-sphere.shaking {
    animation: shakeSphere 0.12s ease-in-out infinite;
}
@keyframes shakeSphere {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-8px, 5px) rotate(-2deg); }
    40% { transform: translate(6px, -7px) rotate(3deg); }
    60% { transform: translate(-7px, -4px) rotate(-1deg); }
    80% { transform: translate(5px, 6px) rotate(2deg); }
}
.eightball-face {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 2px 2px 8px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.3);
}
.eightball-number {
    font-size: 3rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #000000;
    line-height: 1;
}
.eightball-window {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #030712, #020617);
    border: 2px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 0 25px rgba(59,130,246,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.eightball-triangle {
    width: 0;
    height: 0;
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 78px solid rgba(30,58,138,0.85);
    position: relative;
    filter: drop-shadow(0 0 8px rgba(59,130,246,0.5));
    display: flex;
    justify-content: center;
}
.eightball-answer-text {
    position: absolute;
    top: 22px;
    width: 68px;
    text-align: center;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1.25;
    font-family: 'Outfit', sans-serif;
}
.eightball-answer-text.answer-positive {
    color: #34d399;
    filter: drop-shadow(0 0 4px rgba(52,211,153,0.5));
}
.eightball-answer-text.answer-negative {
    color: #f87171;
    filter: drop-shadow(0 0 4px rgba(248,113,113,0.5));
}
.eightball-answer-text.answer-neutral {
    color: #60a5fa;
    filter: drop-shadow(0 0 4px rgba(96,165,250,0.5));
}

/* Tarot card 3D flip styling */
.tarot-card-scene {
    perspective: 1000px;
}
.tarot-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}
.tarot-card.flipped {
    transform: rotateY(180deg);
}
.tarot-card-face {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.tarot-card-back {
    background: linear-gradient(135deg, #1e1b4b, #311042);
    color: #fbbf24;
}
.tarot-back-pattern {
    font-size: 2rem;
    width: 88%;
    height: 92%;
    border: 1px dashed rgba(251,191,36,0.3);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(251,191,36,0.05) 10%, transparent 10.5%);
    background-size: 15px 15px;
}
.tarot-card-front {
    background: rgba(30, 41, 59, 0.95);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}
.tarot-card-emoji {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.tarot-card-name {
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}
.tarot-card-result {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding: 0.2rem 1rem;
    border-radius: 9999px;
    display: inline-block;
}
.tarot-card-result.result-positive {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}
.tarot-card-result.result-negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
}
.tarot-card-result.result-neutral {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.tarot-card-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* ── Plinko Drop Buttons ── */
.plinko-drop-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: bold;
}
.plinko-drop-btn:hover {
    background: rgba(99, 102, 241, 0.6);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.plinko-drop-btn.disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   GASHAPON RETRO MACHINE
   ═══════════════════════════════════════════════ */
.gasha-machine-body {
    width: 200px;
    height: 320px;
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    border-radius: 1.5rem;
    border: 4px solid #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 4px 10px rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    position: relative;
}
.gasha-dome {
    width: 170px;
    height: 140px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50% 50% 10% 10%;
    border: 3px solid #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 10px 20px rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
}
.gasha-dome-glass {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    z-index: 2;
}
.gasha-capsules-container {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.gasha-passive-cap {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 1px 1px 4px rgba(255, 255, 255, 0.4);
}
.capsule-red { background: linear-gradient(180deg, #ef4444 50%, #ffffff 50%); }
.capsule-blue { background: linear-gradient(180deg, #3b82f6 50%, #ffffff 50%); }
.capsule-yellow { background: linear-gradient(180deg, #f59e0b 50%, #ffffff 50%); }
.capsule-pink { background: linear-gradient(180deg, #ec4899 50%, #ffffff 50%); }
.capsule-green { background: linear-gradient(180deg, #10b981 50%, #ffffff 50%); }

.gasha-controls {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    background: #991b1b;
}
.gasha-dial-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #7f1d1d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.gasha-dial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.15s;
}
.gasha-dial-handle {
    width: 34px;
    height: 10px;
    background: #64748b;
    border-radius: 5px;
    position: absolute;
}
.gasha-slot {
    width: 80px;
    height: 50px;
    background: #450a0a;
    border-radius: 0.5rem;
    border: 2px solid #ffffff;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gasha-slot-tray {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.gasha-dispensed-cap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 1px 1px 4px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    position: absolute;
}
.gasha-pop-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    animation: particleExplosion 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Animations */
.dropping-capsule {
    animation: capsuleDrop 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.shaking-dome {
    animation: shakeDome 0.15s ease-in-out infinite;
}
.spinning-dial {
    animation: spinDial 1.5s ease-in-out forwards;
}

@keyframes shakeDome {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(0, 3px) rotate(1deg); }
}
@keyframes spinDial {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(720deg); }
}
@keyframes capsuleDrop {
    0% { transform: translateY(-160px) scale(0.2); opacity: 0; }
    50% { transform: translateY(0) scale(1); opacity: 1; }
    65% { transform: translateY(-8px); }
    80% { transform: translateY(0); }
    90% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}
@keyframes particleExplosion {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
.gasha-dispensed-cap.opening {
    animation: capsuleSplit 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}
@keyframes capsuleSplit {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* ═══════════════════════════════════════════════
   COLOR PALETTE GENERATOR
   ═══════════════════════════════════════════════ */
.palette-hex-btn {
    transition: background 0.2s, transform 0.1s;
}
.palette-hex-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}
.palette-lock-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.palette-lock-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1);
}
.palette-lock-btn.locked {
    background: rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fbbf24 !important;
}

/* Range slider custom styles */
#pass-length-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    height: 6px;
    outline: none;
}
#pass-length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
}
#pass-length-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background-color: #4f46e5;
}

/* ═══════════════════════════════════════════════
   ROSHAMBO DUEL MATCH
   ═══════════════════════════════════════════════ */
.ro-hand {
    font-size: 3.5rem;
    transition: transform 0.2s ease;
}
.ro-choice-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #94a3b8;
}
.ro-choice-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
    transform: translateY(-3px);
}
.ro-choice-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}
.ro-result-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    padding: 0.4rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.banner-win {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}
.banner-lose {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}
.banner-draw {
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid #94a3b8;
    color: #cbd5e1;
}
.banner-neutral {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366f1;
    color: #818cf8;
}

.shaking-player {
    animation: shakePlayer 0.5s ease-in-out infinite;
}
.shaking-cpu {
    animation: shakeCpu 0.5s ease-in-out infinite;
}
@keyframes shakePlayer {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(15px) rotate(-6deg); }
}
@keyframes shakeCpu {
    0%, 100% { transform: translateY(0) rotate(180deg); }
    50% { transform: translateY(15px) rotate(186deg); }
}

.clashing-player {
    animation: clashPlayer 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.clashing-cpu {
    animation: clashCpu 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes clashPlayer {
    0% { transform: translateY(0); }
    30% { transform: translateY(-25px) scale(1.1); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}
@keyframes clashCpu {
    0% { transform: translateY(0) rotate(180deg); }
    30% { transform: translateY(-25px) scale(1.1) rotate(180deg); }
    100% { transform: translateY(0) rotate(180deg); }
}

/* ═══════════════════════════════════════════════
   DECISION GRID MATRIX
   ═══════════════════════════════════════════════ */
.matrix-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.matrix-cell.scanning {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.matrix-cell.winner {
    background: rgba(251, 191, 36, 0.2) !important;
    border-color: #fbbf24 !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.4), inset 0 0 10px rgba(251, 191, 36, 0.15);
    animation: matrixWinnerPulse 0.5s ease-in-out infinite alternate;
}
@keyframes matrixWinnerPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

/* ═══════════════════════════════════════════════
   RPG LOOT BOX
   ═══════════════════════════════════════════════ */
.loot-chest-container {
    perspective: 800px;
    width: 200px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.loot-chest {
    width: 140px;
    height: 120px;
    background: linear-gradient(135deg, #78350f, #451a03);
    border: 4px solid #f59e0b;
    border-radius: 1rem 1rem 0.25rem 0.25rem;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 4px 10px rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
.loot-chest:hover {
    transform: scale(1.05);
}
.loot-chest-lid {
    width: 140px;
    height: 50px;
    background: linear-gradient(180deg, #f59e0b 20%, #b45309 20%);
    border-bottom: 4px solid #451a03;
    position: absolute;
    top: 0;
    left: -4px;
    border-radius: 0.8rem 0.8rem 0 0;
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}
.loot-chest.open .loot-chest-lid {
    transform: rotateX(-110deg) translateY(-5px);
}
.loot-chest-lock {
    width: 28px;
    height: 28px;
    background: #fbbf24;
    border: 3px solid #78350f;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translateX(-50%);
    z-index: 20;
}
.loot-chest.shaking {
    animation: chestRattle 0.12s ease-in-out infinite;
}
@keyframes chestRattle {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(-4px, 2px) rotate(-2deg); }
    40% { transform: translate(3px, -3px) rotate(3deg); }
    60% { transform: translate(-3px, -2px) rotate(-1deg); }
    80% { transform: translate(4px, 4px) rotate(2deg); }
}

/* Card Reveal */
.loot-card-scene {
    perspective: 1000px;
    width: 180px;
    height: 250px;
    z-index: 30;
}
.loot-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: rotateY(0deg) scale(0.2);
    opacity: 0;
}
.loot-card.reveal {
    transform: rotateY(180deg) scale(1);
    opacity: 1;
}
.loot-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 1rem;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
}
.loot-card-back {
    background: radial-gradient(circle, #312e81, #1e1b4b);
    border-color: rgba(255,255,255,0.15);
    color: #fbbf24;
}
.loot-card-front {
    background: #0f172a;
    transform: rotateY(180deg);
}

/* Rarity Tiers */
.rarity-common { border-color: #94a3b8 !important; box-shadow: 0 0 20px rgba(148,163,184,0.3) !important; color: #cbd5e1; }
.rarity-rare { border-color: #3b82f6 !important; box-shadow: 0 0 25px rgba(59,130,246,0.4) !important; color: #60a5fa; }
.rarity-epic { border-color: #a855f7 !important; box-shadow: 0 0 30px rgba(168,85,247,0.5) !important; color: #c084fc; }
.rarity-legendary { border-color: #eab308 !important; box-shadow: 0 0 40px rgba(234,179,8,0.7) !important; color: #fde047; animation: legendaryGlow 1.5s ease-in-out infinite alternate; }

@keyframes legendaryGlow {
    0% { box-shadow: 0 0 25px rgba(234,179,8,0.5); }
    100% { box-shadow: 0 0 50px rgba(234,179,8,0.9); }
}

/* ═══════════════════════════════════════════════
   WORD SCRAMBLER (SPLIT-FLAP)
   ═══════════════════════════════════════════════ */
.split-flap-container {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    perspective: 400px;
}
.split-flap-tile {
    width: 42px;
    height: 60px;
    background: #020617;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: #38bdf8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.1);
    overflow: hidden;
}
.split-flap-tile::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #090d16;
    z-index: 5;
}
.split-flap-tile.flipping {
    animation: flapSpin 0.15s linear infinite;
}
@keyframes flapSpin {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); filter: brightness(0.5); }
    100% { transform: rotateX(0deg); }
}

/* ── Mobile Momentum & Scroll Containment ── */
.overflow-y-auto, #module-nav, #module-container, #history-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Casino General Styles ── */
.casino-panel {
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 2px 10px rgba(255,255,255,0.05);
}
.casino-chips-pill {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(234, 179, 8, 0.05));
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 9999px;
    padding: 0.3rem 0.8rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fde047;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.1);
}

/* ── Roulette Board UI ── */
.roulette-bet-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    background: rgba(255,255,255,0.05);
    padding: 4px;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.08);
}
.roulette-bet-square {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    user-select: none;
}
.roulette-bet-square.red { background: #ef4444; color: #fff; }
.roulette-bet-square.red:hover { background: #f87171; }
.roulette-bet-square.black { background: #0f172a; color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.roulette-bet-square.black:hover { background: #1e293b; }
.roulette-bet-square.green { background: #10b981; color: #fff; }
.roulette-bet-square.green:hover { background: #34d399; }
.roulette-bet-square.active-bet {
    box-shadow: 0 0 12px #eab308, inset 0 0 8px #eab308;
    border: 2px solid #eab308 !important;
}

/* ── Video Poker ── */
.poker-card-hold {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #eab308;
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
}
.poker-held {
    box-shadow: 0 0 15px rgba(234,179,8,0.4), -2px 4px 10px rgba(0,0,0,0.3) !important;
    transform: translateY(-8px) !important;
}

/* ── Baccarat ── */
.baccarat-felt {
    display: flex;
    gap: 1rem;
    width: 100%;
}
.baccarat-spot {
    flex: 1;
    border-radius: 0.75rem;
    border: 2px dashed rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.02);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.baccarat-spot:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}
.baccarat-spot.active {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.1);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.15);
}


