/**
 * Lightning Casino - Dice Game Styles
 * All classes use .dice- prefix
 */

/* ============================================
   LAYOUT
   ============================================ */

.dice-container {
    width: 100%;
    max-width: 600px;
    min-width: 0;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

/* ============================================
   ROLL DISPLAY - Big animated number
   ============================================ */

.dice-roll-display {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(165deg, rgba(20, 20, 25, 0.97), rgba(12, 12, 15, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.dice-roll-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.5;
}

.dice-roll-number {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 3.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    position: relative;
}

.dice-roll-number.dice-win {
    color: #4ade80;
    text-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
}

.dice-roll-number.dice-loss {
    color: #f87171;
    text-shadow: 0 0 30px rgba(248, 113, 113, 0.4);
}

.dice-roll-number.dice-rolling {
    color: #f7931a;
    animation: diceFlicker 0.08s infinite;
}

@keyframes diceFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.dice-roll-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
    font-weight: 500;
    min-height: 1.2em;
}

.dice-roll-label.dice-win { color: rgba(74, 222, 128, 0.8); }
.dice-roll-label.dice-loss { color: rgba(248, 113, 113, 0.8); }

.dice-roll-payout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: transparent;
    min-height: 1.4em;
}

.dice-roll-payout.dice-win {
    color: #4ade80;
}

.dice-roll-payout.dice-loss {
    color: #f87171;
}

/* Win/loss flash on the container */
.dice-roll-display.dice-flash-win {
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.1);
}

.dice-roll-display.dice-flash-loss {
    border-color: rgba(248, 113, 113, 0.3);
    box-shadow: 0 0 40px rgba(248, 113, 113, 0.08);
}

/* ============================================
   RANGE BAR - Visual target/roll indicator
   ============================================ */

.dice-range-bar {
    position: relative;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dice-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(74, 222, 128, 0.2);
    border-right: 2px solid rgba(74, 222, 128, 0.6);
    transition: width 0.15s ease, left 0.15s ease, right 0.15s ease, border-left 0.15s ease, border-right 0.15s ease;
}

.dice-range-fill.dice-over {
    border-right: none;
    border-left: 2px solid rgba(74, 222, 128, 0.6);
}

.dice-range-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #f7931a;
    transform: translateX(-50%);
    transition: left 0.2s ease;
    z-index: 2;
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.6);
    display: none;
}

.dice-range-marker.dice-visible {
    display: block;
}

.dice-range-marker.dice-win { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.dice-range-marker.dice-loss { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }

.dice-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.25rem;
}

/* ============================================
   CONTROLS - Direction toggle + slider + stats
   ============================================ */

.dice-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Direction Toggle */
.dice-direction-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dice-dir-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dice-dir-btn.dice-active {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.dice-dir-btn:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Slider */
.dice-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dice-slider-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    min-width: 45px;
}

.dice-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.dice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7931a, #e8850f);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.4);
    transition: transform 0.15s ease;
}

.dice-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dice-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7931a, #e8850f);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.4);
}

.dice-target-input {
    width: 70px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.dice-target-input:focus {
    outline: none;
    border-color: rgba(247, 147, 26, 0.5);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
}

/* Live Stats */
.dice-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.dice-stat {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.dice-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0.25rem;
}

.dice-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.dice-stat-value.dice-multiplier {
    color: #f7931a;
}

/* ============================================
   WAGER SELECTOR
   ============================================ */

.dice-wager-selector {
    display: flex;
    justify-content: flex-start;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0.75rem;
}

.dice-wager-selector::-webkit-scrollbar {
    display: none;
}

.dice-wager-chip {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    flex-shrink: 0;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.dice-wager-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.dice-wager-chip.dice-active {
    background: #f7931a;
    border-color: #f7931a;
    color: #0c0c0f;
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.4);
}

/* ============================================
   ROLL BUTTON
   ============================================ */

.dice-roll-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dice-roll-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffaa33, #f7931a);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(247, 147, 26, 0.3);
}

.dice-roll-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.dice-roll-btn.dice-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ============================================
   HISTORY STRIP
   ============================================ */

.dice-history {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.dice-history::-webkit-scrollbar {
    display: none;
}

.dice-history-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 52px;
    gap: 0.15rem;
}

.dice-history-item.dice-hist-win {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
}

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

.dice-hist-roll {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.dice-hist-win .dice-hist-roll { color: #4ade80; }
.dice-hist-loss .dice-hist-roll { color: #f87171; }

.dice-hist-dir {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
}

.dice-hist-profit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
}

.dice-hist-win .dice-hist-profit { color: #4ade80; }
.dice-hist-loss .dice-hist-profit { color: #f87171; }

.dice-history-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
    padding: 0.5rem;
    width: 100%;
}

/* ============================================
   MAX PAYOUT CAP (subtle, informational)
   ============================================ */

.dice-cap-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.25rem;
    padding: 0.2rem 0;
}

.dice-cap-note svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.dice-capped-note {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.35rem;
    font-style: italic;
}

/* ============================================
   INSUFFICIENT BALANCE
   ============================================ */

.dice-insufficient-msg {
    text-align: center;
    font-size: 0.8rem;
    color: #f59e0b;
    padding: 0.5rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 8px;
    display: none;
}

/* ============================================
   SOUND TOGGLE
   ============================================ */

.dice-sound-toggle {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================
   SESSION STATS (sidebar)
   ============================================ */

.dice-session-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.dice-session-stat {
    text-align: center;
}

.dice-session-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.dice-session-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.15rem;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .dice-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .dice-roll-number {
        font-size: 2.5rem;
    }

    .dice-roll-display {
        padding: 0.75rem;
    }

    .dice-roll-label {
        margin-top: 0.25rem;
        font-size: 0.75rem;
    }

    .dice-roll-payout {
        font-size: 1rem;
    }

    .dice-controls {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .dice-dir-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .dice-stats-row {
        gap: 0.3rem;
    }

    .dice-stat {
        padding: 0.35rem 0.25rem;
    }

    .dice-stat-value {
        font-size: 0.85rem;
    }

    .dice-stat-label {
        font-size: 0.6rem;
    }

    .dice-wager-chip {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
        min-width: 38px;
    }

    .dice-roll-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .dice-target-input {
        width: 60px;
        font-size: 0.8rem;
    }

    .dice-range-bar {
        height: 32px;
    }
}

@media (max-width: 360px) {
    .dice-container {
        padding: 0.35rem;
        gap: 0.4rem;
    }

    .dice-wager-selector {
        justify-content: flex-start;
        gap: 0.25rem;
    }

    .dice-wager-chip {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
        min-width: 32px;
    }

    .dice-roll-number {
        font-size: 2.2rem;
    }

    .dice-roll-display {
        padding: 0.5rem;
    }

    .dice-roll-label {
        font-size: 0.7rem;
    }

    .dice-roll-payout {
        font-size: 0.9rem;
    }

    .dice-controls {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .dice-range-bar {
        height: 28px;
    }

    .dice-range-labels {
        font-size: 0.6rem;
    }

    .dice-roll-btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}
