/**
 * TREZOR DICE - 100% STAKE.COM CLONE
 */
:root {
    --stake-bg-dark: #0f212e;
    --stake-bg-light: #213743;
    --stake-bg-input: #0f212e;
    --stake-border: #2f4553;
    --stake-border-hover: #557086;
    --stake-text-muted: #b1bad3;
    --stake-text-white: #ffffff;
    --stake-green: #00e701;
    --stake-green-hover: #1fff20;
    --stake-red: #ed3e53;
}

.dice-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--stake-bg-dark);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 900px;
    margin: 20px auto;
    overflow: hidden;
}

/* Desktop Flex Layout */
@media (min-width: 768px) {
    .dice-wrapper {
        flex-direction: row;
        height: 500px;
    }
    .stake-controls {
        width: 300px;
        border-right: none;
        background: var(--stake-bg-light);
    }
    .stake-game-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: var(--stake-bg-dark);
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
    }
}

/* --- SIDEBAR CONTROLS --- */
.stake-controls {
    background: var(--stake-bg-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--stake-text-muted);
    display: flex;
    justify-content: space-between;
}

.control-group label span.balance {
    font-weight: 500;
}

.stake-input-wrapper {
    display: flex;
    background: var(--stake-bg-input);
    border: 2px solid var(--stake-border);
    border-radius: 4px;
    height: 40px;
    align-items: center;
    transition: border-color 0.2s;
}

.stake-input-wrapper:focus-within {
    border-color: var(--stake-border-hover);
}

.stake-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--stake-text-white);
    font-size: 14px;
    font-weight: 600;
    padding: 0 10px;
    outline: none;
    width: 100%;
}

.stake-input-append {
    display: flex;
    gap: 2px;
    padding: 4px;
}

.stake-input-append button {
    background: var(--stake-border);
    border: none;
    color: var(--stake-text-white);
    padding: 0 10px;
    height: 28px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.stake-input-append button:hover {
    background: var(--stake-border-hover);
}

.currency-icon {
    margin-right: 12px;
    color: var(--stake-text-muted);
    font-weight: bold;
    font-size: 14px;
}

.stake-bet-btn {
    background: var(--stake-green);
    color: #000;
    border: none;
    padding: 16px;
    margin-top: auto;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.stake-bet-btn:hover {
    background: var(--stake-green-hover);
}

.stake-bet-btn.rolling {
    background: var(--stake-border);
    color: var(--stake-text-muted);
    cursor: not-allowed;
}

/* --- GAME AREA (SLIDER & STRIP) --- */
.stake-game-area {
    padding: 40px;
    position: relative;
}

.slider-container {
    padding: 30px 20px;
    position: relative;
    user-select: none;
}

.slider-track {
    height: 16px;
    background: var(--stake-border);
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.win-zone {
    height: 100%;
    position: absolute;
    top: 0;
    border-radius: 8px;
    transition: width 0.1s linear, left 0.1s linear, background-color 0.2s;
}

.lose-zone {
    height: 100%;
    position: absolute;
    top: 0;
    border-radius: 8px;
    background-color: var(--stake-red);
    transition: width 0.1s linear, left 0.1s linear, background-color 0.2s;
}

#dice-slider {
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    z-index: 10;
    cursor: grab;
    padding: 0;
    margin: 0;
}

#dice-slider:active {
    cursor: grabbing;
}

#dice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 32px;
    background: var(--stake-text-white);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    position: relative;
}
#dice-slider::-webkit-slider-thumb::before {
    content: '||';
    color: #ccc;
    font-size: 10px;
    text-align: center;
    display: block;
    line-height: 32px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    color: var(--stake-text-muted);
}

.target-flag {
    position: absolute;
    top: -45px;
    background: var(--stake-text-white);
    color: #000;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: left 0.1s linear;
}
.target-flag::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--stake-text-white) transparent transparent transparent;
}

/* --- STATS STRIP --- */
.stake-stats-strip {
    background: var(--stake-bg-light);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding: 12px;
}

.stake-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--stake-bg-input);
    padding: 10px;
    margin: 4px;
    border-radius: 4px;
    position: relative;
    border: 2px solid var(--stake-border);
    transition: border-color 0.2s;
}

.stake-stat:focus-within {
    border-color: var(--stake-border-hover);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stake-stat label {
    font-size: 12px;
    font-weight: 600;
    color: var(--stake-text-muted);
}

.stake-stat input {
    background: transparent;
    border: none;
    color: var(--stake-text-white);
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    outline: none;
}

.stake-stat .suffix {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: var(--stake-text-white);
    font-weight: bold;
    font-size: 16px;
    pointer-events: none;
}

.switch-btn {
    background: var(--stake-border);
    border: none;
    border-radius: 3px;
    color: var(--stake-text-muted);
    padding: 2px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}
.switch-btn:hover {
    background: var(--stake-text-muted);
    color: var(--stake-bg-dark);
}

/* Roll Drop Animation */
.roll-marker {
    position: absolute;
    width: 6px;
    height: 24px;
    top: -4px;
    border-radius: 2px;
    z-index: 5;
    margin-left: -3px;
    transition: opacity 0.5s;
    background: var(--stake-text-white);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 1px solid #000;
}
