/* Common styles */
body {
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

/* Page-specific background colors */
body.menu-page {
    background-color: #2c3e50;
    color: white;
}

body.blackjack-page {
    background-color: #2c3e50;
}

body.roulette-page {
    background-color: #2c3e50;
}

body.plinko-page {
    background-color: #2c3e50;
}

body.dice-page {
    background-color: #2c3e50;
}

/* Game containers */
.menu, .blackjack-game, .roulette-game, .plinko-machine, .dice-game {
    background-color: #34495e;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.menu {
    min-width: 600px;
}

.game-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.game-settings {
    background: rgba(44, 62, 80, 0.8);
    padding: 20px;
    border-radius: 10px;
    color: #ecf0f1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Common elements */
h1 {
    color: #ecf0f1;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.menu h1 {
    color: #ecf0f1;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.stats {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    color: #ecf0f1;
    margin-bottom: 20px;
}

#lastWin {
    margin-left: 1rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.win { color: #2ecc71; }
.loss { color: #e74c3c; }

.rules {
    color: #ecf0f1;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: left;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

/* Menu-specific styles */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.game-card {
    background: rgba(52, 73, 94, 0.8);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #ecf0f1;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.game-card:not(.coming-soon):hover {
    background: #2c3e50;
    border-color: #e74c3c;
    transform: translateY(-5px);
}

.game-card h2 {
    margin: 0 0 10px 0;
    color: #e74c3c;
}

.game-card p {
    margin: 0;
    font-size: 0.9em;
    color: #bdc3c7;
}

.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.coming-soon::after {
    content: "Coming Soon";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.9);
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

/* Blackjack specific styles */
.game-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
}

.player-area, .dealer-area {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
}

.area-label {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
}

.card {
    width: 80px;
    height: 120px;
    background-color: #ecf0f1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.card-content {
    font-size: 2rem;
    position: absolute;
}

.card-content.top-left {
    top: 5px;
    left: 10px;
}

.card-content.bottom-right {
    bottom: 5px;
    right: 10px;
    transform: rotate(180deg);
}

.card-suit {
    font-size: 2.5rem;
}

.card.red {
    color: #e74c3c;
}

.card.black {
    color: #2c3e50;
}

.card.hidden {
    background-image: linear-gradient(45deg, #e74c3c 25%, transparent 25%), 
                      linear-gradient(-45deg, #e74c3c 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #e74c3c 75%), 
                      linear-gradient(-45deg, transparent 75%, #e74c3c 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.score-display {
    color: #ecf0f1;
    margin-top: 0.5rem;
    font-size: 1.2rem;
}

/* Roulette specific styles */
.wheel-area, .bet-area {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
}

/* Placeholder wheel */
.wheel-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background-color: #2c3e50;
    border: 5px solid #ecf0f1;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-center {
    font-size: 1.5rem;
    color: #ecf0f1;
    text-align: center;
}

.result-display {
    color: #ecf0f1;
    margin-top: 1rem;
    font-size: 1.5rem;
    height: 2rem;
}

/* Betting table */
.betting-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 5px;
    max-width: 300px;
    margin: 0 auto;
}

.bet-button {
    padding: 10px;
    border: 1px solid #ecf0f1;
    color: #ecf0f1;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

.bet-button.selected {
    border: 2px solid gold;
    box-shadow: 0 0 5px gold;
}

.bet-button.red {
    background-color: #e74c3c;
}

.bet-button.black {
    background-color: #2c3e50;
}

.bet-button:hover {
    opacity: 0.8;
}

/* Special bets */
.special-bets {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.special-bet {
    flex: 1;
    margin: 0 5px;
    padding: 10px;
    border: 1px solid #ecf0f1;
    color: #ecf0f1;
    cursor: pointer;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.3);
}

.special-bet:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Plinko specific styles */
#plinkoCanvas {
    background-color: #2c3e50;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Risk selector */
.risk-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.risk-selector h3 {
    margin: 0;
    color: #e74c3c;
}

.risk-selector select {
    padding: 8px;
    border-radius: 5px;
    background: #34495e;
    color: #ecf0f1;
    border: 1px solid #e74c3c;
    cursor: pointer;
}

.risk-selector select:hover {
    background: #2c3e50;
}

.risk-description {
    font-size: 0.9em;
    color: #bdc3c7;
}

.risk-description p {
    margin: 5px 0;
}

/* Dice specific styles */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.dice {
    width: 100px;
    height: 100px;
    background-color: #ecf0f1;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease;
}

.rolling {
    animation: roll 0.5s infinite;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.prediction-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.prediction-btn {
    font-family: 'Courier New', Courier, monospace;
    padding: 0.5rem;
    width: 45px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.prediction-btn.selected {
    background-color: #3498db;
}

.prediction-btn:hover:not(.selected) {
    background-color: #95a5a6;
}

/* Common controls */
.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-controls h3 {
    margin: 0;
    color: #e74c3c;
}

.action-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
}

.action-controls h3 {
    margin: 0;
    color: #e74c3c;
}

button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

button:hover:not(:disabled) {
    background-color: #c0392b;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#betAmount {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    padding: 0.5rem;
    width: 100%;
    border: none;
    border-radius: 5px;
    text-align: center;
    box-sizing: border-box;
}

#rollButton, #dropButton {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#rollButton {
    width: 200px;
}

/* Reset balance button */
#resetBalance {
    margin-top: 10px;
    padding: 5px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
}

#resetBalance:hover {
    background-color: #7f8c8d;
}

/* Powerups */
.powerups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.powerups h3 {
    margin: 0;
    color: #e74c3c;
}

.powerup-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.powerup {
    padding: 0.5rem 1rem;
    background-color: #8e44ad;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    opacity: 0.7;
    text-align: left;
    display: flex;
    justify-content: space-between;
}

.powerup:hover:not(:disabled) {
    background-color: #9b59b6;
    opacity: 1;
}

.powerup:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.powerup-cost {
    font-size: 0.8em;
    opacity: 0.8;
}

/* Quick switch menu */
.quick-switch {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-switch a {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-switch a:hover {
    background: #c0392b;
}

.quick-switch a.current {
    background: #2c3e50;
    cursor: default;
}

.quick-switch a.current:hover {
    background: #2c3e50;
}

/* Animations */
@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.fade-out {
    animation: fadeOut 4s forwards;
}

@keyframes dealCard {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.dealing {
    animation: dealCard 0.3s forwards;
}

@keyframes roll {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes ballDrop {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.ball-dropping {
    animation: ballDrop 0.3s forwards;
}