* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: #1a1a1a;
    color: white;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.game-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--theme-color, #ffcc00);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    font-size: 3rem;
}

.theme-switcher-container {
    text-align: center;
    margin-bottom: 20px;
}

.theme-dropdown {
    padding: 8px 15px;
    background-color: var(--theme-color, #ffcc00);
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    min-width: 150px;
    transition: all 0.2s;
}

.theme-dropdown:hover {
    background-color: var(--theme-color-hover, #ffd700);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.theme-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.5);
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-container {
    border-radius: 10px;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: url('images/scrabble/background.jpg') no-repeat center center / cover;
}

#gameCanvas {
    z-index: 2;
    border-radius: 10px;
    max-width: 100%;
}

.reels-canvas {
    max-width: 650px;
    position: absolute;
    /* Adjust according to your design */
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    /* Place above the gameCanvas if needed */
}

.game-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin: 0
}

.balance-section,
.bet-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance-display {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1.2rem;
    border: 2px solid #ffcc00;
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ffcc00;
}

button {
    background-color: #ffcc00;
    color: #1a1a2e;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#decreaseBet,
#increaseBet {
    padding: 5px 10px;
    font-size: 1.2rem;
}

/* Hide the default spin button since we're using the canvas version */
#spinButton {
    display: none;
}

/* Hide the HTML spin button, balance display and bet controls - we're showing them on canvas now */
#spinButton,
.balance-display,
.bet-controls {
    display: none;
}

.game-info {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.paytable,
.history {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ffcc00;
}

h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffcc00;
}

.paytable-content,
.history-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.paytable-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.paytable-symbol {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: contain;
}

.paytable-multiplier {
    margin-left: auto;
    font-weight: bold;
    color: #ffcc00;
}

.history-item {
    padding: 8px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.win {
    color: #4caf50;
}

.loss {
    color: #ff3366;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
    }

    .game-controls {
        flex-direction: column;
        gap: 15px;
    }
}

/* Mobile styles - removes padding, margins, and borders to maximize canvas size */
@media only screen and (max-width: 767px) {
    body {
        padding: 0;
        margin: 0;
    }

    .game-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
    }

    .canvas-container {
        margin: 0;
        padding: 0;
    }

    .reels-canvas {
        position: absolute;
        /* Adjust according to your design */
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;
        /* Place above the gameCanvas if needed */
    }

    #gameCanvas {
        border: none;
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        height: auto;
        z-index: 1;
    }

    .game-controls {
        padding: 10px;
    }

    .reels-canvas {
        width: 100%;
        height: auto;
        z-index: 0;
    }
}

/* Styles for the Paytable Information Section */
.paytable-info {
    padding: 15px 20px;
    /* Add some spacing around the text */
    margin-bottom: 15px;
    /* Space between info and table grid */
    /* background-color: rgba(0, 0, 0, 0.3); */
    /* Optional subtle background */
    /* border: 1px solid #ffcc00; */
    /* Optional border matching UI */
    border-radius: 8px;
    /* Optional rounded corners */
    color: #eee;
    /* Light text color for dark backgrounds */
    font-size: 0.95em;
    line-height: 1.5;
}

.paytable-title {
    color: #ffdd44;
    /* Brighter gold for the title */
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.4em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    /* Subtle shadow */
}

.paytable-explanation {
    margin-bottom: 10px;
    /* Space between paragraphs */
    text-align: left;
    /* Or 'center' if you prefer */
}

.paytable-explanation strong {
    color: #ffcc00;
    /* Highlight key terms in gold */
    font-weight: 600;
    /* Slightly bolder */
}

.paytable-note {
    font-size: 0.85em;
    color: #aaa;
    /* Subdued color for the note */
    text-align: center;
    margin-top: 15px;
}

.paytable-separator {
    border: none;
    border-top: 1px solid #ffcc00;
    /* Gold line separator */
    opacity: 0.6;
    margin: 20px auto 10px auto;
    /* Center and space */
    width: 80%;
}

/* Existing Paytable Grid Styles (Ensure they work well with the above) */
.paytable-header {
    /* Your existing styles */
    font-weight: bold;
    color: #ffcc00;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 204, 0, 0.5);
    margin-bottom: 8px;
}

.paytable-row {
    /* Your existing styles */
    display: grid;
    /* Consider using grid for alignment */
    grid-template-columns: 2fr 1fr 1fr 1fr;
    /* Adjust column ratios */
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paytable-row:last-child {
    border-bottom: none;
}

.paytable-row span {
    text-align: center;
    /* Center text in grid cells */
}

.paytable-symbol-cell {
    text-align: left !important;
    /* Align symbol name left */
    display: flex;
    align-items: center;
}

.paytable-symbol-img {
    width: 30px;
    /* Adjust size as needed */
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
}

.paytable-fallback-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 1px solid #555;
    vertical-align: middle;
}

.paytable-grid {
    width: 100%;
    /* Make table take full width of its container */
    border-collapse: collapse;
    /* Merge borders */
    margin-top: 15px;
    /* Space below the info text */
    color: #eee;
    /* Default text color */
    font-size: 0.9em;
    /* Adjust base font size */
}

.paytable-grid th,
.paytable-grid td {
    border: 1px solid rgba(255, 204, 0, 0.3);
    /* Subtle gold border */
    padding: 8px 10px;
    /* Padding inside cells */
    text-align: center;
    /* Center-align text by default */
    vertical-align: middle;
    /* Vertically align content */
}

.paytable-grid th {
    background-color: rgba(255, 204, 0, 0.15);
    /* Slightly tinted background for header */
    color: #ffdd44;
    /* Brighter gold for header text */
    font-weight: bold;
    text-transform: uppercase;
    /* Optional: Uppercase headers */
    font-size: 0.95em;
}

/* Style specific columns if needed */
.paytable-grid th:first-child,
/* Symbol Header */
.paytable-grid td.paytable-symbol-cell {
    /* Symbol Data Cell */
    text-align: left;
    /* Align symbol name left */
    width: 40%;
    /* Give symbol column more width */
}

.paytable-grid td.paytable-multiplier-cell {
    font-weight: 600;
    /* Make multiplier numbers slightly bolder */
    font-size: 1.05em;
}

/* Keep Symbol image/fallback styles */
.paytable-symbol-cell {
    display: flex;
    align-items: center;
}

.paytable-symbol-img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
    /* Ensure image aligns nicely */
}

.paytable-fallback-color {
    display: inline-block;
    width: 25px;
    /* Slightly bigger */
    height: 25px;
    margin-right: 10px;
    border: 1px solid #555;
    vertical-align: middle;
    flex-shrink: 0;
    /* Prevent shrinking */
}

/* Keep Paytable Info Section Styles */
.paytable-info {
    padding: 15px 20px;
    margin-bottom: 0;
    /* Remove bottom margin as table handles spacing */
    /* background-color: rgba(0, 0, 0, 0.3); */
    /* border: 1px solid #ffcc00; */
    border-radius: 8px 8px 0 0;
    /* Round only top corners if desired */
    color: #eee;
    font-size: 0.95em;
    line-height: 1.5;
}

.paytable-title {
    color: #ffdd44;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.4em;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.paytable-explanation {
    margin-bottom: 10px;
    text-align: left;
}

.paytable-explanation strong {
    color: #ffcc00;
    font-weight: 600;
}

.paytable-note {
    font-size: 0.85em;
    color: #aaa;
    text-align: center;
    margin-top: 15px;
}

/* No separator needed */
/*
.paytable-separator { ... }
*/