/* ============================================
   PLINKO - Diseño Casino Profesional
   Estilo: dark purple/navy + neon highlights
   UTF-8 limpio - Sin caracteres corruptos
   ============================================ */

.plinko-wrapper {
    min-height: 100vh;
    background: #1a1d2e;
    padding: 80px 16px 32px;
}

.plinko-game-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 16px;
    align-items: start;
}

/* ============================================
   PANEL IZQUIERDO
   ============================================ */
.plinko-left-panel {
    background: #252840;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Tabs Manual / Auto */
.mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #1a1d2e;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.mode-tab {
    background: transparent;
    border: none;
    color: #8892b0;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.mode-tab.active {
    background: #353860;
    color: #fff;
}

/* Section labels */
.section-label {
    display: block;
    color: #8892b0;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Risk mode buttons */
.risk-section {}

.risk-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.risk-btn {
    background: #1a1d2e;
    border: 1.5px solid #353860;
    color: #8892b0;
    padding: 9px 4px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
}

.risk-btn:hover {
    border-color: #6366f1;
    color: #fff;
}

.risk-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.lightning-btn {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.lightning-btn.active {
    background: rgba(251,191,36,0.2);
    border-color: #fbbf24;
    color: #fbbf24;
}

/* Bet input */
.bet-section {}

.bet-input-row {
    margin-bottom: 8px;
}

.bet-input-container {
    display: flex;
    align-items: center;
    background: #1a1d2e;
    border: 1.5px solid #353860;
    border-radius: 10px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.2s;
}

.bet-input-container:focus-within {
    border-color: #6366f1;
}

.bet-icon {
    color: #8892b0;
    font-size: 1rem;
    font-weight: 700;
}

.bet-input-field {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px 0;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.bet-input-field::-webkit-outer-spin-button,
.bet-input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.bet-quick-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.bet-quick-btn {
    background: #1a1d2e;
    border: 1.5px solid #353860;
    color: #a0aec0;
    padding: 9px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.bet-quick-btn:hover {
    border-color: #6366f1;
    color: #fff;
    background: #353860;
}

/* Lines */
.lines-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.line-btn {
    background: #1a1d2e;
    border: 1.5px solid #353860;
    color: #8892b0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.line-btn:hover {
    border-color: #6366f1;
    color: #fff;
}

.line-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* Toggle velocidad */
.speed-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: #1a1d2e;
    border: 1.5px solid #353860;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.toggle-track.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #8892b0;
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.toggle-track.active .toggle-knob {
    transform: translateX(20px);
    background: #6366f1;
}

.toggle-label {
    color: #a0aec0;
    font-size: 0.88rem;
    font-weight: 500;
}

/* Boton Jugar */
.play-btn {
    width: 100%;
    background: #f7a61a;
    border: none;
    color: #1a1d2e;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(247, 166, 26, 0.35);
}

.play-btn:hover {
    background: #ffb733;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(247, 166, 26, 0.5);
}

.play-btn:active {
    transform: translateY(0);
}

.play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Balance row */
.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1d2e;
    border-radius: 10px;
    padding: 10px 14px;
}

.balance-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-amount {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.deposit-btn {
    background: transparent;
    border: 1.5px solid #353860;
    color: #a0aec0;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.deposit-btn:hover {
    border-color: #6366f1;
    color: #fff;
}

/* ============================================
   PANEL CENTRAL - TABLERO
   ============================================ */
.plinko-center-panel {
    background: #252840;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#plinkoCanvas {
    width: 100%;
    display: block;
    border-radius: 10px;
    background: transparent;
}

/* Barra de multiplicadores - degradado rojo>naranja>amarillo>verde>amarillo>naranja>rojo */
.multipliers-bar {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding: 0 2px;
}

.mult-slot {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    position: relative;
    transition: transform 0.15s, filter 0.15s;
    cursor: default;
    user-select: none;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    min-width: 0;
}

.mult-slot.hit {
    transform: scaleY(1.12) scaleX(1.08);
    filter: brightness(1.5) saturate(1.5);
    z-index: 2;
}

/* Colores segun posicion - simetrico */
/* Extremos: ROJO fuerte (multiplier alto) */
.mult-slot.color-extreme { background: linear-gradient(180deg, #e84040 0%, #c82020 100%); }
/* Casi extremo: NARANJA-ROJO */
.mult-slot.color-high { background: linear-gradient(180deg, #f16a2a 0%, #d44d10 100%); }
/* Medio-alto: NARANJA */
.mult-slot.color-mid-high { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); }
/* Medio: AMARILLO */
.mult-slot.color-mid { background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%); }
/* Centro-alto: VERDE-AMARILLO */
.mult-slot.color-center-hi { background: linear-gradient(180deg, #84cc16 0%, #65a30d 100%); }
/* Centro: VERDE */
.mult-slot.color-center { background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%); }

/* Ticker resultados */
.results-ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    overflow: hidden;
    min-height: 32px;
}

.ticker-items {
    display: flex;
    gap: 6px;
    overflow: hidden;
    flex-wrap: nowrap;
}

.ticker-chip {
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.3s;
    animation: tickerSlideIn 0.3s ease-out;
}

.ticker-chip.win {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.ticker-chip.loss {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.ticker-chip.jackpot {
    background: rgba(217, 70, 239, 0.25);
    border-color: rgba(217, 70, 239, 0.5);
    color: #f0abfc;
    animation: tickerJackpot 0.5s ease-out;
}

@keyframes tickerSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes tickerJackpot {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   PANEL DERECHO
   ============================================ */
.plinko-right-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-box, .history-box {
    background: #252840;
    border-radius: 16px;
    padding: 20px;
}

.panel-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #353860;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(53,56,96,0.5);
}

.stat-line:last-child {
    border-bottom: none;
}

.stat-name {
    color: #8892b0;
    font-size: 0.85rem;
}

.stat-val {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.text-green { color: #34d399 !important; }
.text-red { color: #f87171 !important; }

/* Historial */
.history-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #353860 transparent;
}

.history-empty {
    text-align: center;
    padding: 30px 0;
    color: #4a5568;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.history-empty p {
    margin: 0;
    font-size: 0.85rem;
}

.history-item {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    animation: historySlideIn 0.3s ease-out;
}

@keyframes historySlideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.history-item.win {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.06);
}

.history-item.loss {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.06);
}

.history-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.history-mult {
    font-size: 1rem;
    font-weight: 800;
}

.history-mult.win { color: #34d399; }
.history-mult.loss { color: #f87171; }

.history-time {
    color: #4a5568;
    font-size: 0.78rem;
}

.history-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

.history-bet-label { color: #8892b0; }
.history-profit { font-weight: 700; }

/* ============================================
   EFECTOS DE PARTICULAS (notificacion WIN)
   ============================================ */
.win-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #d946ef, #8b5cf6);
    border: 2px solid rgba(217, 70, 239, 0.6);
    border-radius: 20px;
    padding: 24px 40px;
    text-align: center;
    z-index: 9999;
    pointer-events: none;
    animation: winNotifShow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 0 60px rgba(217, 70, 239, 0.5), 0 20px 40px rgba(0,0,0,0.4);
}

.win-notification h2 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 6px;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.win-notification p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

@keyframes winNotifShow {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes winNotifHide {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .plinko-game-layout {
        grid-template-columns: 240px 1fr 220px;
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .plinko-game-layout {
        grid-template-columns: 1fr;
    }

    .plinko-center-panel {
        order: -1;
    }

    .plinko-left-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .play-btn, .balance-row, .mode-tabs {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .plinko-wrapper {
        padding: 70px 10px 20px;
    }

    .plinko-left-panel {
        display: flex;
        flex-direction: column;
    }

    .risk-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .mult-slot {
        font-size: 0.68rem;
        padding: 6px 2px;
    }
}
