/* ========================================
   Plinko Game Styles
   Mirrors slot-machine.css patterns
   ======================================== */

/* Main wrapper */
.plinko-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 12px;
    padding: 10px 0;
    transform: scale(0.85);
    transform-origin: top center;
}

/* Game area (canvas container) */
.plinko-game-area {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #f1c40f;
    box-shadow:
        0 0 20px rgba(241, 196, 15, 0.3),
        inset 0 0 15px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.4);
    background: #0d1117;
}

/* Canvas */
.plinko-canvas {
    display: block;
    cursor: pointer;
}

/* Bucket strip (below canvas) */
.plinko-buckets {
    display: flex;
    width: 560px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    border: 2px solid rgba(241, 196, 15, 0.4);
    border-top: none;
}

.plinko-bucket {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    min-height: 36px;
    transition: all 0.3s ease;
    position: relative;
}

.plinko-bucket .bucket-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.plinko-bucket.active {
    animation: bucketPulse 0.5s ease-in-out 3;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    z-index: 1;
}

@keyframes bucketPulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.3); }
}

/* Drop button */
.plinko-drop-button {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid #f1c40f;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 15px rgba(241, 196, 15, 0.3),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.plinko-drop-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow:
        0 0 25px rgba(241, 196, 15, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

.plinko-drop-button:active:not(:disabled) {
    transform: scale(0.95);
}

.plinko-drop-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.plinko-drop-button .plinko-button-text {
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.3;
}

/* Result message */
.plinko-result-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.plinko-result-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.plinko-result-message.win {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

.plinko-result-message.lose {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%);
    color: white;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.5);
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* Desktop */
@media (min-width: 769px) {
    .plinko-wrapper {
        transform: scale(0.85);
    }
}

/* Tablet */
@media (max-width: 768px) {
    .plinko-wrapper {
        transform: scale(0.65);
    }

    .plinko-drop-button {
        width: 120px;
        height: 120px;
    }

    .plinko-drop-button .plinko-button-text {
        font-size: 1rem;
    }
}

/* Medium phones */
@media (max-width: 600px) {
    .plinko-wrapper {
        transform: scale(0.55);
    }

    .plinko-drop-button {
        width: 110px;
        height: 110px;
    }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
    .plinko-wrapper {
        transform: scale(0.48);
    }

    .plinko-drop-button {
        width: 100px;
        height: 100px;
    }

    .plinko-drop-button .plinko-button-text {
        font-size: 0.9rem;
    }
}

/* iPhone 12 Pro Max range */
@media (max-width: 428px) and (min-width: 391px) {
    .plinko-wrapper {
        transform: scale(0.50);
    }

    .plinko-drop-button {
        width: 95px;
        height: 95px;
    }
}

/* iPhone 12 Pro and smaller */
@media (max-width: 390px) {
    .plinko-wrapper {
        transform: scale(0.38);
    }

    .plinko-drop-button {
        width: 90px;
        height: 90px;
    }

    .plinko-drop-button .plinko-button-text {
        font-size: 0.85rem;
    }
}

/* Landscape (short screens) */
@media (orientation: landscape) and (max-height: 500px) {
    .plinko-wrapper {
        transform: scale(0.55);
        padding: 5px 0;
        gap: 5px;
    }

    .plinko-drop-button {
        width: 80px;
        height: 80px;
    }

    .plinko-drop-button .plinko-button-text {
        font-size: 0.8rem;
    }
}

/* Hand tracking mode — larger button */
body.hand-tracking-active .plinko-drop-button {
    width: 200px;
    height: 200px;
}

body.hand-tracking-active .plinko-drop-button .plinko-button-text {
    font-size: 2.6rem;
}
