/* Karma Pusher - 2.5D Arcade Style */

.pusher-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
    perspective: 1000px;
}

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

.pusher-machine {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 4px solid #fbbf24;
    border-radius: 20px;
    padding: 20px;
    max-width: 480px;
    width: 95%;
    box-shadow: 
        0 0 60px rgba(251, 191, 36, 0.3),
        inset 0 2px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
}

/* Ambient glow animation */
.pusher-machine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.03) 0%, transparent 50%);
    animation: ambientGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ambientGlow {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10%, 5%); }
    50% { transform: translate(-5%, 10%); }
    75% { transform: translate(-10%, -5%); }
}

/* Header */
.pusher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.pusher-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pusher-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pusher-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.pusher-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #fbbf24;
    margin: 0;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.pusher-karma-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid #4ade80;
}

.pusher-karma-display .karma-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #4ade80;
    transition: transform 0.2s ease;
}

.pusher-karma-display .karma-amount.pulse {
    animation: karmaPulse 0.3s ease;
}

@keyframes karmaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); color: #86efac; }
}

/* Event Banner */
.pusher-event-banner {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.2));
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 8px 15px;
    margin-bottom: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.pusher-event-banner.active {
    max-height: 80px;
    opacity: 1;
    padding: 10px 15px;
    animation: eventPulse 0.5s ease-out;
}

@keyframes eventPulse {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.event-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.event-effect {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 2px;
}

.event-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #fbbf24;
    transition: width 0.1s linear;
}

/* ==================== 2.5D CABINET ==================== */

.pusher-cabinet {
    background: linear-gradient(180deg, #1a1a2e 0%, #0a0a15 100%);
    border: 3px solid #3a3a5a;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 15px;
    position: relative;
    perspective: 800px;
    transform-style: preserve-3d;
    overflow: visible;
}

/* 3D Scene Container */
.pusher-3d-scene {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(35deg);
    transform-origin: center bottom;
    padding: 10px;
    margin-top: 20px;
}

/* Glass/Play Field Container */
.pusher-glass {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: visible;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Glass reflection effect */
.pusher-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 30%);
    pointer-events: none;
    z-index: 10;
    border-radius: 8px;
}

/* Side Walls - 3D Perspective */
.pusher-wall-left,
.pusher-wall-right {
    position: absolute;
    top: 0;
    bottom: 50px;
    width: 25px;
    background: linear-gradient(180deg, 
        #4a4a6a 0%, 
        #3a3a5a 30%, 
        #2a2a4a 70%, 
        #1a1a3a 100%);
    transform-style: preserve-3d;
    z-index: 5;
}

.pusher-wall-left {
    left: -25px;
    transform: rotateY(90deg);
    transform-origin: right center;
    border-radius: 4px 0 0 4px;
    box-shadow: inset 5px 0 15px rgba(0, 0, 0, 0.5);
}

.pusher-wall-right {
    right: -25px;
    transform: rotateY(-90deg);
    transform-origin: left center;
    border-radius: 0 4px 4px 0;
    box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.5);
}

/* Wall metal trim */
.pusher-wall-left::before,
.pusher-wall-right::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #888 0%, #555 50%, #333 100%);
}

.pusher-wall-left::before { right: 0; }
.pusher-wall-right::before { left: 0; }

/* Bottom Ledge - Where coins fall off */
.pusher-ledge {
    position: absolute;
    bottom: -60px;
    left: -10px;
    right: -10px;
    height: 60px;
    background: linear-gradient(180deg, 
        #3a3a5a 0%, 
        #2a2a4a 40%, 
        #1a1a3a 100%);
    transform: rotateX(-60deg);
    transform-origin: top center;
    transform-style: preserve-3d;
    border-radius: 0 0 12px 12px;
    box-shadow: 
        inset 0 10px 20px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

/* Ledge top edge (where coins roll) */
.pusher-ledge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, 
        #666 0%, 
        #555 50%, 
        #3a3a5a 100%);
    border-radius: 2px;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Ledge coin slot/tray */
.pusher-ledge::after {
    content: '💰 COLLECT 💰';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(74, 222, 128, 0.8);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

/* Win zone glow at the edge */
.pusher-win-zone {
    position: absolute;
    bottom: -5px;
    left: 10px;
    right: 10px;
    height: 40px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(74, 222, 128, 0.1) 40%,
        rgba(74, 222, 128, 0.3) 100%);
    border-bottom: 2px dashed rgba(74, 222, 128, 0.6);
    z-index: 1;
    animation: winZonePulse 2s ease-in-out infinite;
}

@keyframes winZonePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Canvas styling */
#pusher-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
    border-radius: 8px;
}

/* Coin/item depth effect (applied via JS) */
.pusher-item-3d {
    transform-style: preserve-3d;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5));
}

/* Back wall visible behind pusher */
.pusher-back-wall {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, 
        #2a2a4a 0%, 
        #1a1a3a 60%,
        #15152a 100%);
    border-radius: 8px 8px 0 0;
    z-index: -1;
    transform: translateZ(-30px);
    box-shadow: inset 0 -10px 30px rgba(0, 0, 0, 0.5);
}

/* Machine lights on back wall */
.pusher-back-wall::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(251, 191, 36, 0.3) 20%,
        rgba(251, 191, 36, 0.5) 50%,
        rgba(251, 191, 36, 0.3) 80%,
        transparent 100%);
    border-radius: 5px;
    animation: backWallLights 2s ease-in-out infinite;
}

@keyframes backWallLights {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Combo Display */
.combo-display {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(244, 114, 182, 0.9);
    padding: 5px 12px;
    border-radius: 15px;
    opacity: 0;
    transform: scale(0.8) rotateX(-35deg);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 20;
}

.combo-display.show {
    opacity: 1;
    transform: scale(1) rotateX(-35deg);
}

.combo-count {
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
}

.combo-label {
    font-size: 0.7em;
    color: rgba(255,255,255,0.8);
    margin-left: 4px;
}

/* Debug Overlay */
.debug-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.7em;
    color: #4ade80;
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: rotateX(-35deg);
}

.debug-overlay.show {
    opacity: 1;
}

.debug-stat {
    line-height: 1.4;
}

/* Controls */
.pusher-controls {
    margin-bottom: 12px;
}

.drop-position-control {
    margin-bottom: 10px;
}

.drop-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #333 0%, #444 50%, #333 100%);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.drop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #fcd34d, #f59e0b);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
    border: 2px solid #fff;
}

.drop-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.drop-buttons {
    display: flex;
    gap: 10px;
}

/* Buttons */
.pusher-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.pusher-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s ease;
}

.pusher-btn:hover:not(.disabled)::before {
    left: 100%;
}

.drop-btn {
    flex: 2;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.drop-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
}

.drop-multi-btn {
    flex: 1;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    color: #000;
}

.drop-multi-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.5);
}

.upgrade-btn {
    background: linear-gradient(180deg, #c084fc 0%, #a855f7 100%);
    color: #fff;
    padding: 12px 16px;
}

.upgrade-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 132, 252, 0.5);
}

.pusher-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pusher-btn.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.btn-icon { font-size: 1.3em; }
.btn-text { font-size: 0.9em; }
.btn-cost { font-size: 0.75em; opacity: 0.8; }

.pusher-btn-secondary {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.pusher-btn-secondary:hover {
    border-color: #666;
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Stats */
.pusher-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pusher-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.jackpot-stat {
    color: #fbbf24 !important;
    font-weight: bold;
}

/* Footer */
.pusher-footer {
    display: flex;
    justify-content: center;
}

/* ==================== PANELS ==================== */

/* Shared Panel Styles */
.upgrade-panel,
.debug-panel,
.design-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(15, 15, 25, 0.98);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 360px;
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.upgrade-panel { border: 3px solid #c084fc; }
.debug-panel { border: 3px solid #4ade80; }
.design-panel { border: 3px solid #60a5fa; }

.upgrade-panel.show,
.debug-panel.show,
.design-panel.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.upgrade-panel-header,
.debug-panel-header,
.design-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upgrade-panel-header h3 { color: #c084fc; margin: 0; font-size: 1.2em; }
.debug-panel-header h3 { color: #4ade80; margin: 0; font-size: 1.2em; }
.design-panel-header h3 { color: #60a5fa; margin: 0; font-size: 1.2em; }

.upgrade-close,
.debug-close,
.design-close {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}

.upgrade-close:hover { border-color: #c084fc; color: #c084fc; }
.debug-close:hover { border-color: #4ade80; color: #4ade80; }
.design-close:hover { border-color: #60a5fa; color: #60a5fa; }

/* Upgrade Panel */
.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.upgrade-item.affordable {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.upgrade-item.maxed {
    opacity: 0.6;
}

.upgrade-icon {
    font-size: 1.8em;
    width: 40px;
    text-align: center;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-weight: bold;
    color: #fff;
    font-size: 0.95em;
}

.upgrade-level {
    color: #4ade80;
    font-size: 0.8em;
}

.upgrade-desc {
    color: #666;
    font-size: 0.75em;
    margin-top: 2px;
}

.upgrade-action {
    text-align: right;
}

.upgrade-buy-btn {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.upgrade-buy-btn:hover:not(.disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

.upgrade-buy-btn.disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.maxed-label {
    color: #fbbf24;
    font-weight: bold;
    font-size: 0.9em;
}

/* Debug Panel */
.debug-section {
    margin-bottom: 15px;
}

.debug-section h4 {
    color: #888;
    font-size: 0.85em;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.debug-btn {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid #4ade80;
    color: #4ade80;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.debug-btn:hover {
    background: rgba(74, 222, 128, 0.2);
}

.debug-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.debug-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Design Panel */
.design-section {
    margin-bottom: 15px;
}

.design-section h4 {
    color: #888;
    font-size: 0.85em;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.design-sliders {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.design-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.design-slider-row label {
    width: 120px;
    font-size: 0.8em;
    color: #aaa;
}

.design-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
}

.design-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.design-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.design-value {
    width: 40px;
    text-align: right;
    font-family: monospace;
    font-size: 0.8em;
    color: #60a5fa;
}

.design-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.design-btn {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid #60a5fa;
    color: #60a5fa;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.design-btn:hover {
    background: rgba(96, 165, 250, 0.2);
}

/* Notifications */
.notification-container {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 50;
}

.notification {
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 10px currentColor;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-align: center;
}

/* Particles */
.particle-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10001;
    overflow: hidden;
}

/* Falling coin animation for collections */
@keyframes coinFall {
    0% {
        transform: translateY(0) rotateY(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(80px) rotateY(720deg);
        opacity: 0;
    }
}

.falling-coin {
    position: absolute;
    animation: coinFall 0.8s ease-in forwards;
    font-size: 1.5em;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    .pusher-machine {
        padding: 15px;
        border-radius: 16px;
    }

    .pusher-title {
        font-size: 1.2em;
    }

    .pusher-3d-scene {
        transform: rotateX(30deg);
    }

    .drop-buttons {
        flex-wrap: wrap;
    }

    .drop-btn {
        flex: 1 1 60%;
    }

    .drop-multi-btn,
    .upgrade-btn {
        flex: 1 1 35%;
    }

    .upgrade-panel,
    .debug-panel,
    .design-panel {
        width: 95%;
        padding: 15px;
    }
    
    .design-slider-row label {
        width: 90px;
    }

    .pusher-wall-left,
    .pusher-wall-right {
        width: 15px;
    }

    .pusher-wall-left { left: -15px; }
    .pusher-wall-right { right: -15px; }

    .pusher-ledge {
        height: 40px;
        bottom: -40px;
    }
}
