/* ==========================================================================
   Webliner Jeux - Styles & Animations des 5 Jeux (games.css)
   Roue de la fortune, Machine à sous, Grattage, Coffres mystères, Plinko
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 🎡 ROUE DE LA FORTUNE
   -------------------------------------------------------------------------- */
.wheel-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.wheel-outer-casing {
    position: relative;
    width: min(340px, 85vw);
    height: min(340px, 85vw);
    max-width: 380px;
    max-height: 380px;
    margin: 10px auto 25px auto;
    border-radius: 50%;
    padding: 10px;
    background: radial-gradient(circle, #2A303C 0%, #151922 100%);
    box-shadow: 
        0 0 0 6px #1E232E,
        0 0 0 10px #F59E0B,
        0 0 25px rgba(245, 158, 11, 0.4),
        inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 480px) {
    .wheel-outer-casing {
        width: 360px;
        height: 360px;
    }
}

.wheel-lights-ring {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    pointer-events: none;
}

.wheel-bulb {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFD166;
    box-shadow: 0 0 8px #FFD166;
    animation: bulbBlink 1.2s infinite alternate;
}

@keyframes bulbBlink {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 12px #FFD166, 0 0 20px #F59E0B; }
}

.wheel-canvas-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    transition: transform cubic-bezier(0.1, 0.9, 0.2, 1);
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 44px;
    z-index: 20;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
    transform-origin: 50% 10px;
    transition: transform 0.08s ease-out;
}

.wheel-pointer svg {
    width: 100%;
    height: 100%;
    fill: #EF4444;
}

.wheel-pointer.tick {
    transform: translateX(-50%) rotate(-18deg);
}

.wheel-center-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFD166, #F59E0B, #B45309);
    border: 4px solid #FFFFFF;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), 0 0 15px rgba(245, 158, 11, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wheel-center-hub:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.wheel-center-hub:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* --------------------------------------------------------------------------
   2. 🎰 MACHINE À SOUS (JACKPOT SLOTS)
   -------------------------------------------------------------------------- */
.slot-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.slot-cabinet {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(180deg, #2D3748 0%, #1A202C 100%);
    border: 3px solid #F59E0B;
    border-radius: var(--radius-xl);
    padding: 20px 16px 24px 16px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(245, 158, 11, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
}

.slot-marquee-header {
    background: linear-gradient(135deg, #B45309, #F59E0B, #FFD166);
    color: #111827;
    text-align: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slot-marquee-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.slot-reels-window {
    background: #0B0F17;
    border: 3px solid #374151;
    border-radius: var(--radius-lg);
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    position: relative;
    box-shadow: inset 0 6px 16px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    height: 170px;
}

/* Ligne de gain centrale */
.slot-payline {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 8px #EF4444;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 5;
}

.slot-payline.winning {
    height: 4px;
    background: #FFD166;
    box-shadow: 0 0 16px #FFD166, 0 0 30px #F59E0B;
    animation: paylineLaser 0.6s infinite alternate;
}

@keyframes paylineLaser {
    0% { opacity: 0.5; }
    100% { opacity: 1; filter: brightness(1.4); }
}

.slot-reel-column {
    position: relative;
    background: linear-gradient(180deg, #1E2533 0%, #2A3447 50%, #1E2533 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
}

.slot-reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s linear;
}

.slot-symbol-item {
    height: 70px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
    user-select: none;
}

.slot-symbol-item span {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
}

.slot-symbol-item.winning {
    animation: winningSymbolPulse 0.8s infinite alternate ease-in-out;
}

@keyframes winningSymbolPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.15); filter: brightness(1.3) drop-shadow(0 0 10px #FFD166); }
}

/* --------------------------------------------------------------------------
   3. 🎫 CARTE À GRATTER (SCRATCH & WIN)
   -------------------------------------------------------------------------- */
.scratch-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.scratch-card-box {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, #1E293B, #0F172A);
    border: 2px solid #F59E0B;
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.2);
    margin-bottom: 20px;
    overflow: hidden;
}

.scratch-card-header {
    text-align: center;
    margin-bottom: 12px;
}

.scratch-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFD166;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scratch-card-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.scratch-surface-container {
    position: relative;
    width: 100%;
    height: 190px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
    user-select: none;
    touch-action: none;
}

.scratch-hidden-reward {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #1E293B, #0B0E14);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    z-index: 1;
}

.scratch-hidden-icon {
    font-size: 3.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.scratch-hidden-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFFFFF;
}

.scratch-hidden-subtitle {
    font-size: 0.78rem;
    color: #F59E0B;
    font-weight: 600;
}

#scratchCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: crosshair;
    touch-action: none;
}

.scratch-progress-bar-wrap {
    width: 100%;
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scratch-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.scratch-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #F59E0B, #10B981);
    transition: width 0.15s ease-out;
}

.scratch-progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 42px;
}

/* --------------------------------------------------------------------------
   4. 🎁 BOÎTES & COFFRES MYSTÈRES (MYSTERY BOXES)
   -------------------------------------------------------------------------- */
.mystery-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mystery-chests-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 380px;
    margin: 10px auto 25px auto;
}

@media (min-width: 480px) {
    .mystery-chests-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 460px;
    }
}

.mystery-box-item {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.mystery-box-item:hover:not(.disabled) {
    transform: translateY(-6px) scale(1.04);
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), 0.12);
    box-shadow: 0 10px 25px rgba(var(--brand-primary-rgb), 0.3);
}

.mystery-box-item.shaking {
    animation: boxRumble 0.5s infinite ease-in-out;
}

@keyframes boxRumble {
    0%, 100% { transform: rotate(0deg) scale(1.05); }
    25% { transform: rotate(-5deg) scale(1.05); }
    75% { transform: rotate(5deg) scale(1.05); }
}

.mystery-box-item.opened {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(121, 40, 202, 0.2));
    border-color: #FFD166;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.mystery-box-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.mystery-chest-graphic {
    font-size: 3.2rem;
    margin-bottom: 8px;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mystery-box-number {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--brand-accent);
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   5. ⚡ PLINKO LUCKY DROP
   -------------------------------------------------------------------------- */
.plinko-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.plinko-board-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: linear-gradient(180deg, #18202F, #0E131E);
    border: 2px solid #374151;
    border-radius: var(--radius-xl);
    padding: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

#plinkoCanvas {
    width: 100%;
    height: 280px;
    display: block;
    border-radius: var(--radius-md);
    background: radial-gradient(circle at 50% 30%, #1F2937, #0B0F17);
}

.plinko-buckets-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.plinko-bucket-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 6px 2px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.plinko-bucket-item.hit {
    background: #F59E0B;
    color: #111827;
    transform: scale(1.1);
    box-shadow: 0 0 15px #F59E0B;
}
