/* Dice Game Specific Styles */

.game-container {
    background-color: var(--bg-alt);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    margin: 0 auto 40px auto;
    max-width: 650px;
}

/* Tabs */
.game-tabs {
    display: flex;
    background-color: var(--bg-main);
}

.bottom-tabs {
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background-color: var(--bg-alt);
}

/* Main Area */
.dice-main-area {
    padding: 30px;
    background-color: #0b151c; /* Very dark blue-gray */
    position: relative;
}

.fairness-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    letter-spacing: -2px;
    z-index: 0;
}

/* History Pills */
.dice-history {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 40px;
    height: 30px;
    z-index: 1;
    position: relative;
}

.history-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.history-pill.win { background-color: #00e701; } /* Bright Green */
.history-pill.loss { background-color: #ff2020; } /* Bright Red */

/* Slider */
.dice-slider-container {
    margin: 40px 0 60px 0;
    position: relative;
    z-index: 1;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 0 10px;
}

.slider-track-wrap {
    height: 14px;
    background-color: #1a2a36;
    border-radius: 7px;
    position: relative;
    cursor: pointer;
}

.slider-fill-red {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: #ff3b30;
    border-radius: 7px 0 0 7px;
    width: 50%; /* JS controlled */
}

.slider-fill-green {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background-color: #34c759;
    border-radius: 0 7px 7px 0;
    width: 50%; /* JS controlled */
}

.slider-thumb-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    height: 32px;
}

.slider-thumb-wrapper:active {
    cursor: grabbing;
}

.roll-result-tooltip {
    position: absolute;
    top: -45px;
    transform: translateX(-50%);
    background-color: #00e701;
    color: #1a2a36;
    font-weight: 900;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    z-index: 15;
    display: none;
    transition: left 0.3s ease-out;
}

.roll-result-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: inherit transparent transparent transparent;
}



.slider-thumb {
    width: 36px;
    height: 28px;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
}

.thumb-lines {
    width: 14px;
    height: 14px;
    background: repeating-linear-gradient(
        90deg,
        #b0b0b0,
        #b0b0b0 2px,
        transparent 2px,
        transparent 6px
    );
}




/* Controls */
.dice-controls {
    display: flex;
    gap: 20px;
    background-color: #1a2a36;
    padding: 15px;
    border-radius: 8px;
    z-index: 1;
    position: relative;
}

.control-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-box label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.input-with-icon {
    position: relative;
    background-color: #0b151c;
    border-radius: 6px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.input-with-icon input {
    background: transparent;
    border: none;
    color: white;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    outline: none;
}

.input-with-icon .icon-right {
    padding: 0 15px;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
}

.btn-swap {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-swap:hover {
    color: white;
}

/* Bottom Controls */
.bet-controls {
    padding: 25px;
    background-color: var(--bg-alt);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.bet-amount-section {
    margin-bottom: 25px;
}

.bet-amount-section label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.bet-input-wrapper {
    display: flex;
    background-color: var(--bg-main);
    border-radius: 6px;
    overflow: hidden;
    height: 50px;
}

.bet-input-left {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 15px;
}

.ltc-color {
    color: #3498db;
}

.bet-input-left input {
    background: transparent;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 10px;
    width: 100%;
    outline: none;
}

.bet-actions {
    display: flex;
    background-color: #1a2a36;
}

.bet-actions button {
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 700;
    padding: 0 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-actions button:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.btn-roll {
    width: 100%;
    background-color: #34c759;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    letter-spacing: 1px;
}

.btn-roll:hover {
    background-color: #2eb150;
}

.btn-roll:active {
    transform: scale(0.98);
}

.btn-roll.btn-auto-stop {
    background-color: #ff3b30;
}
.btn-roll.btn-auto-stop:hover {
    background-color: #e6352b;
}

/* Auto Settings */
.auto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.auto-box {
    background-color: var(--bg-main);
    padding: 15px;
    border-radius: 8px;
}

.auto-box > label {
    display: block;
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
}

.auto-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.small-input {
    width: 110px;
    height: 35px;
}

.small-input input {
    padding: 8px;
    font-size: 0.9rem;
}

.icon-left {
    padding-left: 15px;
    position: absolute;
}
.padding-left-input {
    padding-left: 40px !important;
}

.mt-40 { margin-top: 40px; }



@media (max-width: 768px) {
    .dice-controls {
        flex-direction: column;
    }
    .auto-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   DESKTOP GAME LAYOUT (2-column)
   Left: Controls | Right: Game Area
   Only on screens >= 900px
   ============================ */

.game-layout-desktop {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto 40px auto;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-alt);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.game-left-panel {
    padding: 24px 20px;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.game-right-panel {
    padding: 24px 20px;
    background-color: #0b151c;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

@media (min-width: 900px) {
    .game-layout-desktop {
        flex-direction: row;
        align-items: stretch;
    }
    .game-left-panel {
        width: 280px;
        min-width: 260px;
        max-width: 300px;
        border-right: 1px solid rgba(255,255,255,0.05);
        flex-shrink: 0;
    }
    .game-right-panel {
        flex: 1;
    }
    .btn-roll {
        margin-top: auto;
    }
}
