/* Base Styles */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --input-bg: #0f3460;
    --input-border: #2a4d7a;
    --text-color: #e2e8f0;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0.5rem;
}

/* Main App Container */
.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem;
    gap: 1rem;
    box-sizing: border-box;
    flex-wrap: nowrap;
    align-items: flex-start;
    min-height: 100vh;
}

/* Dice Simulator - Left Side */
.dice-simulator {
    width: 400px;
    flex-shrink: 0;
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
}

.game-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Result Display */
.result-display {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.result-value {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    padding: 0 15px;
    border-radius: 5px;
}

.result-value.win {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.7);
}

.result-value.lose {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.7);
}

.result-message {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    /* Ensure message text is not affected by parent colors */
    color: var(--text-secondary) !important;
}

/* History Container */
.history-container {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    max-height: 100%;
}

.history-container h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 1.5rem;
    text-align: center;
}

/* Stats Section */
.history-container .stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--input-bg);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.history-container .stats > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.history-container .stats span {
    font-weight: bold;
    color: var(--text-color);
}

/* History Scroll Area */
.history-scroll {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    position: relative;
}

/* Ensure the history scroll area takes up available space */
.history-scroll {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    position: relative;
}

/* History Header */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--input-bg);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 1px solid var(--input-border);
}

.history-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.clear-history-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    background: var(--primary-color);
    color: white;
    opacity: 0.9;
}

.clear-history-btn svg {
    width: 14px;
    height: 14px;
}

/* Roll History Table Styles */
#roll-history {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

#roll-history th, 
#roll-history td {
    padding: 0.5rem;
    text-align: right;
    border-bottom: 1px solid var(--input-bg);
}

#roll-history th {
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

#roll-history tr:last-child td {
    border-bottom: none;
}

/* Profit/Loss Colors */
#roll-history .profit {
    color: var(--success-color);
}

#roll-history .loss {
    color: var(--error-color);
}

/* Align first column to the left */
#roll-history td:first-child,
#roll-history th:first-child {
    text-align: left;
}

/* Center Type and Result columns */
#roll-history td:nth-child(3),
#roll-history th:nth-child(3),
#roll-history td:nth-child(4),
#roll-history th:nth-child(4) {
    text-align: center;
}

/* Table Styling */
#roll-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 100%;
    table-layout: fixed;
    background: var(--card-bg);
}

/* Ensure table takes full width of container */
.history-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Add subtle hover effect */
#roll-history tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

#roll-history thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#roll-history th,
#roll-history td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--input-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-family: 'Roboto Mono', monospace;
}

#roll-history td {
    color: var(--text-secondary);
}

/* Win/Loss colors for all elements */
.win {
    color: var(--success-color) !important;
}

.loss {
    color: var(--error-color) !important;
}

/* Ensure table cells with win/loss classes override default colors */
#roll-history td.win,
#roll-history td .win {
    color: var(--success-color) !important;
}

#roll-history td.loss,
#roll-history td .loss {
    color: var(--error-color) !important;
}

/* Ensure the sign is always shown for profit/loss and total */
#roll-history td:nth-child(6)::before,
#roll-history td:nth-child(7)::before {
    content: attr(data-sign);
    margin-right: 2px;
}

#roll-history tr:last-child td {
    border-bottom: none;
}

#roll-history th:first-child,
#roll-history td:first-child {
    text-align: left;
    width: 15%;
    min-width: 100px;
    padding-left: 1.5rem;
}

#roll-history th {
    background: var(--card-bg);
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Make table cells have a fixed width */
#roll-history th:nth-child(1),
#roll-history td:nth-child(1) { 
    width: 15%; 
    min-width: 100px;
    text-align: left;
    padding-left: 1.5rem;
} /* Bet */
#roll-history th:nth-child(2),
#roll-history td:nth-child(2) { 
    width: 12%; 
    min-width: 100px;
} /* Multiplier */
#roll-history th:nth-child(3),
#roll-history td:nth-child(3) { 
    width: 12%; 
    min-width: 80px;
}  /* Type */
#roll-history th:nth-child(4),
#roll-history td:nth-child(4) { width: 100px; } /* Result */
#roll-history th:nth-child(5),
#roll-history td:nth-child(5) { width: 100px; } /* Payout */
#roll-history th:nth-child(6),
#roll-history td:nth-child(6) { width: 120px; } /* Profit/Loss */
#roll-history th:nth-child(7),
#roll-history td:nth-child(7) { width: 120px; } /* Total */

#roll-history tbody {
    display: block;
    overflow-y: auto;
    max-height: 80vh; /* Adjust based on your header height */
}

#roll-history thead,
#roll-history tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Style for profit/loss cells */
.profit {
    color: var(--success-color);
}

.loss {
    color: var(--error-color);
}

/* Scrollbar styling */
.history-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.history-scroll::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 4px;
}

.history-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.history-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }
    
    .dice-simulator {
        position: static;
        flex: 1;
        width: 100%;
    }
    
    .history-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .history-container .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #roll-history {
        font-size: 0.8rem;
    }
    
    #roll-history th,
    #roll-history td {
        padding: 0.6rem 0.5rem;
    }
}

/* Base Input Styles */
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    height: 44px;
    text-align: center;
    font-family: inherit;
}

/* Input Field with Icons */
.input-field {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    height: 44px;
    padding-right: 2rem; /* Added padding to move suffixes in from the edge */
}

/* Input with infinite button */
.input-field.with-infinite {
    padding-right: 40px; /* Space for the infinite button */
}

/* Infinite button styles */
.infinite-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover effect removed as per user request */

/* Remove border from nested input */
.input-field > input[type="text"],
.input-field > input[type="number"] {
    border: none;
    background: transparent;
    text-align: center;
    padding-right: 36px; /* Make room for the infinite button */
    padding: 0 2rem 0 1rem;
    width: 100%;
    height: 100%;
}

/* Input suffix styling */
.input-field .suffix {
    position: absolute;
    right: 1rem; /* Position from the right edge of the container */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    background: transparent;
    line-height: 1;
    padding: 0;
    margin: 0;
}

/* Bankroll input specific styling */
#bankroll-input {
    font-family: 'Roboto Mono', monospace;
    text-align: center;
}

/* Remove spin buttons for number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    margin: 0;
}

/* Input Row */
.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

/* Ensure bankroll input matches bet amount input */
#bankroll-input,
#bet-amount {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 1rem;
    color: var(--text-color);
    text-align: center;
    height: 36px;
    line-height: 36px;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

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

/* Input Icons */
.input-field .icon-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-field .icon-button:hover {
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.05);
}

.input-field .icon-button + .icon-button {
    right: 2rem;
}

.input-field .text-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.input-field .text-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Bet Controls */
.bet-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.bet-adjust {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: #fff;
    border-radius: 4px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.bet-adjust:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.bet-adjust:active {
    transform: translateY(1px);
}

/* Make sure the bet amount input has enough width */
#bet-amount {
    min-width: 80px;
}

/* Win chance and multiplier inputs */
#win-chance,
#multiplier {
    min-width: 60px;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Radio Buttons */
.input-radio {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.input-radio input[type="radio"] {
    margin-right: 0.5rem;
}

/* Buttons */
button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#set-bankroll {
    background: #4caf50;
}


/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Dice Display */
.dice-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 0.5rem 0;
    text-align: center;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dice-rail {
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    position: relative;
    margin: 0.5rem 0;
    overflow: hidden;
}

.dice-marker {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #ffeb3b;
    box-shadow: 0 0 10px 2px rgba(255, 235, 59, 0.7);
    z-index: 2;
    transition: left 0.3s ease-out;
}

#dice-result {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: #fff;
    transition: all 0.3s ease;
    min-height: 2.5rem;
    line-height: 1.2;
}

#result-message {
color: #aaa;
min-height: 1.2rem;
font-size: 0.9rem;
}

/* Game Info */
.game-info {
margin-top: 1.5rem;
}

.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 1rem;
background: rgba(0, 0, 0, 0.2);
padding: 1rem;
border-radius: var(--border-radius);
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.stats div {
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* Win/Lose States */
.win .dice-marker {
    background: var(--success-color);
    box-shadow: 0 0 10px 2px rgba(76, 175, 80, 0.7);
}

.lose .dice-marker {
    background: var(--error-color);
    box-shadow: 0 0 10px 2px rgba(244, 67, 54, 0.7);
}

.success {
    color: var(--success-color);
}

.error {
    color: var(--error-color);
}

/* Settings Button */
.settings-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1000;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: rotate(30deg);
}

.settings-button svg {
    width: 24px;
    height: 24px;
}

/* Modal */
#settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

#settings-modal .modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

#settings-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

#settings-modal .modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 500;
}

#settings-modal .modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background: var(--card-bg);
}

#settings-modal .form-group {
    margin-bottom: 20px;
}

#settings-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

#settings-modal .input-group {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
    position: relative;
}

#settings-modal .input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-end;
    justify-content: space-between;
}

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

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

#settings-modal .form-control {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 44px;
}

#settings-modal .input-group-append {
    display: flex;
}

#settings-modal .btn-copy {
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    white-space: nowrap;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#settings-modal .btn-copy:hover {
    background-color: var(--button-hover-bg);
}

#settings-modal .btn-copy.copied {
    background-color: var(--success-color);
}

/* Nonce input specific styles */
#settings-modal .nonce-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#settings-modal .nonce-input {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

#settings-modal .btn-reset-nonce {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    height: 44px;
}

#settings-modal .input-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

#settings-modal #nonce {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: monospace;
    font-size: 14px;
}

#settings-modal .text-button {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#settings-modal .text-button:hover {
    background-color: rgba(var(--accent-rgb), 0.1);
}

#settings-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

#settings-modal .button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

#settings-modal .button.primary {
    background-color: var(--accent-color);
    color: white;
}

#settings-modal .button.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

#settings-modal .button.primary:active {
    transform: translateY(0);
}

#settings-modal .close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#settings-modal .close-button:hover {
    background-color: var(--button-hover-bg);
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 600px) {
    #settings-modal .modal-content {
        width: 90%;
        margin: 1rem;
    }
    
    #settings-modal .form-actions {
        flex-direction: column;
    }
    
    #settings-modal .button {
        width: 100%;
    }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    padding: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-color);
}

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

.tab-content {
    margin-top: 1rem;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* Roll Button - Shared styles for both Roll and Start Autobet buttons */
/* Main button styles for both Roll and Start Autobet */
#roll-button,
.autobet-buttons > #start-autobet.roll-button {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 1rem;
    display: block;
    box-sizing: border-box;
}

/* Hover state for both buttons */
#roll-button:hover:not(:disabled),
.autobet-buttons > #start-autobet.roll-button:not(.autobet-running):hover {
    background: linear-gradient(135deg, #0d9e6e, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Active state for both buttons */
#roll-button:active:not(:disabled),
.autobet-buttons > #start-autobet.roll-button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

/* When autobet is running */
.autobet-buttons > #start-autobet.roll-button.autobet-running {
    background: #dc3545;
}

/* Hover state when running */
.autobet-buttons > #start-autobet.roll-button.autobet-running:hover {
    background: #c82333;
}

/* Manual Tab Styles */
#manual .game-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

#manual .roll-button {
    margin-top: 0.5rem;
    width: 100%;
}

/* Autobet Tab Styles */
.autobet-stats {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--input-bg);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.autobet-stats div {
    margin: 0.5rem 0;
}

.autobet-stats span {
    color: var(--text-color);
    font-weight: 500;
}

/* Ensure consistent input field styling */
#autobet .input-field {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
}

#autobet .input-field input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#autobet .input-field input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

#autobet label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

#autobet .input-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.autobet-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.autobet-buttons .roll-button {
    flex: 1;
    margin: 0;
    min-width: 0; /* Prevents flex items from overflowing */
}

.config-button {
    flex: 1;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-button:hover {
    background: var(--input-bg-hover);
    border-color: var(--primary-color);
}

/* Roll button hover state is now handled by #start-autobet specific styles */

.roll-button:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

/* Coming soon messages */
.autobet-content,
.advanced-content {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Bet Action Group Styles */
.bet-action-group {
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.bet-action-group .toggle-group {
    margin-bottom: 0.5rem;
}

.bet-action-group .input-field {
    margin-top: 0.5rem;
}

/* Autobet Modal Styles */
#autobet-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

#autobet-modal .modal-content {
    max-width: 500px;
    margin: 2rem auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#autobet-modal .modal-header {
    padding: 1.25rem 1.5rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--input-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#autobet-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

#autobet-modal .close-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

#autobet-modal .close-button:hover {
    color: var(--text-color);
}

#autobet-modal .modal-body {
    padding: 1.5rem;
}

#autobet-modal .form-group {
    margin-bottom: 1.25rem;
}

#autobet-modal .form-group:last-child {
    margin-bottom: 0;
}

#autobet-modal label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

#autobet-modal select,
#autobet-modal .input-field {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#autobet-modal select:focus,
#autobet-modal .input-field:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
    outline: none;
}

#autobet-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--input-border);
}

#autobet-modal .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

#autobet-modal .btn-primary {
    background: var(--primary-color);
    color: white;
}

#autobet-modal .btn-primary:hover {
    background: #5a4ec9;
    transform: translateY(-1px);
}

#autobet-modal .btn-secondary {
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
}

#autobet-modal .btn-secondary:hover {
    background: var(--input-bg-hover);
    transform: translateY(-1px);
}

/* Responsive styles */
@media (max-width: 600px) {
    #autobet-modal .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    #autobet-modal .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #autobet-modal .btn {
        width: 100%;
    }
}