* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #1a1a1a;
    color: white;
    min-height: 100vh;
}

header {
    padding: 20px;
    background: #000;
    text-align: center;
}

.logo {
    max-width: 300px;
    height: auto;
}

.game-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.left-panel {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-panel {
    display: flex;
    flex-direction: column;
}

.dice-container {
    text-align: center;
    padding: 40px;
    perspective: 600px;
}

.dice {
    width: 100px;
    height: 100px;
    background-image: url('/c1eaaed2-a311-494b-ad71-cffb63ee5d3a_removalai_preview(1)_upscayl_2x_digital-art-4x (1).png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto;
    animation: none;
}

.dice.rolling {
    animation: roll3D 0.5s infinite;
}

@keyframes roll3D {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    50% { transform: rotateX(180deg) rotateY(180deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
}

.input-group-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-group-row .input-group {
    flex: 1;
    min-width: 0;
}

input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #3a3a3a;
    color: white;
    font-size: 16px;
}

.numeric-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #3a3a3a;
    border-radius: 5px;
    background: #3a3a3a;
    color: white;
    font-size: 16px;
    text-align: center;
}

.numeric-input:focus {
    border-color: #ff4444;
    outline: none;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #3a3a3a;
    outline: none;
}

#rollover, #chance {
    -webkit-appearance: none;
    padding: 12px;
    height: auto;
    background: #3a3a3a;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4444;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4444;
    cursor: pointer;
}

label {
    color: #ff4444;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

#multiplier {
    background: rgba(255,68,68,0.1);
    color: #ff4444;
    font-weight: bold;
    text-align: center;
    cursor: text;
}

#multiplier:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.button {
    padding: 25px 40px;  
    border: none;
    border-radius: 12px;  
    background: linear-gradient(135deg, #ff0000, #cc0000);  
    color: white;
    font-size: 24px;  
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 4px 15px rgba(255,0,0,0.4);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);  
    letter-spacing: 2px;  
    width: 100%;  
    margin: 10px 0;
}

#rollButton {
    padding: 25px 40px;  
    border: none;
    border-radius: 12px;  
    background: linear-gradient(135deg, #ff0000, #cc0000);  
    color: white;
    font-size: 24px;  
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 4px 15px rgba(255,0,0,0.4);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);  
    letter-spacing: 2px;  
    width: 100%;  
    margin: 10px 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,0,0,0.6);
    background: linear-gradient(135deg, #ff1a1a, #e60000);  
}

#rollButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,0,0,0.6);
    background: linear-gradient(135deg, #ff1a1a, #e60000);  
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255,0,0,0.4);
}

#rollButton:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255,0,0,0.4);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#rollButton:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result {
    text-align: center;
    margin-top: 20px;
    font-size: 24px;
    min-height: 36px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(0,0,0,0.1);
}

.result.win {
    color: #4CAF50;
}

.result.lose {
    color: #ff4444;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    margin-top: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.history-item.win {
    color: #4CAF50;
}

.history-item.lose {
    color: #ff4444;
}

.balance {
    position: absolute;
    top: -20px;
    right: 20px;
    background: #4CAF50;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance::before {
    content: '⟠';  
    font-size: 20px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-value {
    min-width: 100px;
    text-align: right;
}

.rollover, 
div.rollover,
.rollover-container,
div.rollover-container {
    display: none !important;
}

.win-chance-slider {
    position: relative;
    height: 20px;
    background: linear-gradient(to right, #4CAF50 0%, #4CAF50 50%, #ff4444 50%, #ff4444 100%);
    border-radius: 10px;
    margin: 15px 0;
}

.win-chance-slider::before {
    content: '1';
    position: absolute;
    top: -25px;
    left: 0;
    color: #fff;
    font-size: 14px;
}

.win-chance-slider::after {
    content: '99';
    position: absolute;
    top: -25px;
    right: 0;
    color: #fff;
    font-size: 14px;
}

.win-chance-slider .middle-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    content: '50';
}

.slider-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.slider-handle:hover {
    transform: translateX(-50%) scale(1.1);
}

.bet-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-navigation {
    display: flex;
    background: #222;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    color: #999;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: #333;
    color: #ff4444;
    font-weight: bold;
}

.tab-content {
    display: none;
    background: #222;
    border-radius: 5px;
    padding: 10px;
}

.tab-content.active {
    display: block;
}

.bet-multipliers {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bet-multi-btn {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    background: #3a3a3a;
    border: 1px solid #ff4444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-multi-btn:hover {
    background: #ff4444;
    transform: translateY(-1px);
}

.input-group .numeric-input {
    margin-bottom: 10px;
}

.input-group .slider-container {
    margin-top: 5px;
}

@media screen and (max-width: 768px) {
    body {
        font-family: Arial, sans-serif;
        background: #1a1a1a;
        color: white;
        padding: 10px;
    }
    
    .game-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 10px;
        padding: 15px;
        background: #1a1a1a;
        border-radius: 8px;
        max-width: 100%;
    }
    
    header {
        background: #000;
        text-align: center;
        padding: 15px 10px;
        margin-bottom: 5px;
    }
    
    .logo {
        max-width: 200px;
        height: auto;
    }
    
    .balance {
        position: static;
        width: auto;
        background: #2a2a2a;
        padding: 12px 15px;
        border-radius: 5px;
        font-size: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
        box-shadow: none;
    }
    
    .balance::before {
        content: 'Balance:';
        color: #999;
        font-size: 16px;
    }
    
    #balance {
        color: #4CAF50;
        font-size: 16px;
        font-weight: normal;
    }
    
    .input-group {
        background: #2a2a2a;
        padding: 12px 15px;
        border-radius: 5px;
        margin-bottom: 5px;
    }

    .input-group {
        background: #2a2a2a;
        padding: 12px 15px;
        border-radius: 5px;
        margin-bottom: 5px;
    }

    .input-group .slider-container {
        display: block !important;
        padding: 10px 0;
    }

    .input-group .slider-container input[type="range"] {
        width: 100%;
        display: block;
        margin: 10px 0;
        -webkit-appearance: none;
        height: 8px;
        border-radius: 4px;
        background: #3a3a3a;
    }

    .input-group .slider-container input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        background: #ff4444;
        border-radius: 50%;
        cursor: pointer;
    }

    .input-group .slider-container input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #ff4444;
        border-radius: 50%;
        cursor: pointer;
    }

    .bet-input-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 5px;
    }

    .bet-input-container .numeric-input {
        width: 100%;
        margin-right: 0;
        order: -1;
    }

    .slider-container {
        display: block !important;
    }

    .slider-value {
        display: none;
    }
    
    .input-group label {
        display: block;
        color: #999;
        font-size: 14px;
        margin-bottom: 8px;
        font-weight: normal;
    }
    
    .numeric-input {
        background: #333;
        border: none;
        border-radius: 3px;
        color: white;
        font-size: 14px;
        padding: 8px 10px;
        height: auto;
        text-align: center;
    }
    
    .slider-container {
        padding: 10px 0;
    }
    
    #rollButton {
        padding: 20px 30px;
        font-size: 22px;
    }
    
    .bet-input-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 5px;
    }

    .bet-input-container .numeric-input {
        width: 100%;
        margin-right: 0;
        order: -1;
    }

    .bet-multipliers {
        display: flex;
        gap: 5px;
        width: 100%;
    }

    .bet-multi-btn {
        flex: 1;
        background: #333;
        border: none;
        color: white;
        padding: 8px 10px;
        border-radius: 3px;
        font-size: 14px;
    }
    
    .bet-multipliers {
        display: flex;
        gap: 5px;
        margin-top: 5px;
    }
    
    .bet-multi-btn {
        background: #333;
        border: none;
        color: white;
        padding: 8px 10px;
        border-radius: 3px;
        font-size: 14px;
    }
    
    .result {
        margin: 10px 0;
        text-align: center;
        font-size: 16px;
        color: #ff4444;
    }
    
    .result.win {
        color: #4CAF50;
    }
    
    .tab-navigation {
        display: flex;
        background: #222;
        border-radius: 5px;
        overflow: hidden;
        margin: 10px 0;
    }
    
    .tab {
        flex: 1;
        padding: 10px 0;
        border: none;
        background: transparent;
        color: #999;
        font-size: 14px;
        cursor: pointer;
    }
    
    .tab.active {
        color: #ff4444;
        background: transparent;
        font-weight: normal;
    }
    
    .tab-content {
        background: #1a1a1a;
        border-radius: 0;
        padding: 0;
    }
    
    .win-chance-slider {
        height: 20px;
        background: linear-gradient(to right, 
            #4CAF50 0%, 
            #4CAF50 50%, 
            #ff4444 50%, 
            #ff4444 100%
        );
        border-radius: 0;
        position: relative;
        margin: 30px 0 15px 0;  
    }
    
    .win-chance-slider::before,
    .win-chance-slider::after,
    .win-chance-slider .middle-label {
        font-size: 12px;
    }
    
    .slider-handle {
        position: absolute;
        width: 20px;
        height: 20px;
        background: white;
        border-radius: 50%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        cursor: pointer;
    }
    
    .controls-labels {
        display: flex;
        margin-bottom: 10px;
    }
    
    .controls-label {
        flex: 1;
        text-align: center;
        color: #999;
        font-size: 14px;
        padding: 8px;
        background: #333;
        margin: 0 2px;
    }
    
    .input-label {
        display: block;
        color: #ff4444;
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .control-input {
        background: #333;
        border: none;
        border-radius: 3px;
        color: white;
        font-size: 14px;
        padding: 8px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    #multiplier {
        background: rgba(255, 0, 0, 0.2);
    }
    
    .slider-value,
    #multiplierValue,
    #rolloverValue,
    #chanceValue {
        display: none;
    }
    
    .bet-input-container {
        display: flex;
        margin-bottom: 5px;
    }
    
    .bet-input-container .numeric-input {
        flex: 1;
        margin-right: 5px;
    }
    
    .bet-actions {
        display: flex;
        gap: 5px;
    }
    
    .history-list {
        background: transparent;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .history-item {
        background: #2a2a2a;
        padding: 10px;
        margin-bottom: 5px;
        border-radius: 3px;
    }
    
    .input-group-row {
        display: none !important;
    }
    
    .rollover-container,
    div.rollover {
        display: none !important;
    }
}


@media screen and (max-width: 480px) {
    .game-container {
        padding: 15px;
        margin: 5px;
    }

    header {
        padding: 10px;
    }

    .logo {
        max-width: 200px;
    }

    .input-group {
        padding: 15px;
    }

    .numeric-input {
        font-size: 18px;
        padding: 15px;
    }

    .slider-container {
        padding: 10px 0;
    }

    #rollButton {
        padding: 20px 30px;
        font-size: 22px;
    }

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

    .bet-multi-btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    .result {
        font-size: 20px;
        padding: 10px 0;
    }

    .history-list {
        margin-top: 15px;
    }
}

@media (hover: none) and (pointer: coarse) {
    input[type="range"] {
        height: 30px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }

    .button, 
    #rollButton,
    .bet-multi-btn {
        min-height: 48px;
    }

    .numeric-input {
        padding: 15px;
        font-size: 16px;
    }
}

@media screen and (min-width: 769px) {
    #multiplierMobile,
    #rolloverMobile,
    #chanceMobile,
    .mobile-control,
    .control-item label {
        display: none !important;
    }
}


/* Custom Dice Styles - Add at the end of styles.css */

/* Override existing dice styles */
.dice {
    width: 180px;
    min-height: 100px;
    background-image: none;
    background-color: transparent;
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out, opacity 0.3s ease-in-out;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    animation: none;
    opacity: 1;
}

/* Update rolling animation to be smoother and slower */
.dice.rolling {
    animation: roll3D 0.8s ease-in-out infinite;
}

@keyframes roll3D {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    33% { transform: rotateX(120deg) rotateY(120deg); }
    66% { transform: rotateX(240deg) rotateY(240deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Add dice-face for our new implementation with transparent background */
.dice-face {
    width: 80px;
    height: 80px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: opacity 0.2s ease-in-out;
}

/* When there are multiple dice, adjust their size and spacing */
.dice:has(> .dice-face + .dice-face) {
    gap: 15px;
}

.dice:has(> .dice-face + .dice-face) .dice-face {
    width: 70px;
    height: 70px;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .dice {
        width: 150px;
    }
    
    .dice-face {
        width: 70px;
        height: 70px;
    }
    
    .dice:has(> .dice-face + .dice-face) .dice-face {
        width: 60px;
        height: 60px;
    }
}