/* ============================================
   RULETA DE LUJO - CASINO VIRTUAL
   Tema: Negro y Dorado Premium
   ============================================ */

:root {
    /* Colores principales */
    --gold-primary: #FFD700;
    --gold-dark: #B8860B;
    --gold-light: #FFF8DC;
    --black-primary: #0A0A0A;
    --black-secondary: #1A1A1A;
    --black-tertiary: #2A2A2A;
    
    /* Colores de la ruleta */
    --red-roulette: #C41E3A;
    --black-roulette: #000000;
    --green-roulette: #006400;
    
    /* Colores de estado */
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    
    /* Efectos y sombras */
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.5);
    --glow-gold-strong: 0 0 30px rgba(255, 215, 0, 0.8);
    --shadow-deep: 0 10px 40px rgba(0, 0, 0, 0.8);
    --shadow-card: 0 5px 20px rgba(0, 0, 0, 0.6);
    
    /* Tipografías */
    --font-title: 'Cinzel', serif;
    --font-elegant: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* ============================================
   RESET Y BASE
   ============================================ */

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

body {
    font-family: var(--font-body);
    background: var(--black-primary);
    color: var(--gold-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Fondo de lujo con textura */
.luxury-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(184, 134, 11, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #0A0A0A 100%);
    z-index: -1;
}

.luxury-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 215, 0, 0.02) 2px,
            rgba(255, 215, 0, 0.02) 4px
        );
    opacity: 0.3;
}

/* ============================================
   SISTEMA DE PANTALLAS
   ============================================ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ============================================
   PANTALLA DE BIENVENIDA
   ============================================ */

.welcome-container {
    text-align: center;
    z-index: 2;
    animation: fadeInUp 1s ease;
}

.logo-container {
    margin-bottom: 60px;
}

.logo-container i {
    font-size: 120px;
    color: var(--gold-primary);
    text-shadow: var(--glow-gold-strong);
    animation: rotateSlow 20s linear infinite;
}

.main-title {
    font-family: var(--font-title);
    font-size: 72px;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: var(--glow-gold-strong);
    margin: 20px 0;
    letter-spacing: 4px;
}

.subtitle {
    font-family: var(--font-elegant);
    font-size: 28px;
    color: var(--gold-light);
    font-weight: 300;
    letter-spacing: 2px;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 50px;
}

/* ============================================
   BOTONES DE LUJO
   ============================================ */

.btn-luxury {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    padding: 18px 50px;
    border: 2px solid var(--gold-primary);
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    color: var(--gold-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.btn-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-luxury:hover::before {
    left: 100%;
}

.btn-luxury:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    color: var(--black-primary);
    border-color: var(--gold-light);
    box-shadow: var(--glow-gold-strong);
    transform: translateY(-3px);
}

.btn-luxury:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    color: var(--black-primary);
    box-shadow: var(--glow-gold);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--black-tertiary) 0%, var(--black-secondary) 100%);
}

.btn-tertiary {
    background: transparent;
    border: 1px solid var(--gold-dark);
    font-size: 16px;
    padding: 12px 30px;
    min-width: auto;
}

.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-action {
    font-size: 24px;
    padding: 20px 60px;
    animation: pulse 2s infinite;
}

/* ============================================
   PANTALLAS DE AUTENTICACIÓN
   ============================================ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.auth-box {
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 20px;
    padding: 50px;
    min-width: 450px;
    box-shadow: var(--shadow-deep);
    animation: fadeInUp 0.6s ease;
}

.auth-box h2 {
    font-family: var(--font-title);
    font-size: 36px;
    color: var(--gold-primary);
    text-align: center;
    margin-bottom: 40px;
    text-shadow: var(--glow-gold);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    background: var(--black-primary);
    border: 2px solid var(--black-tertiary);
    border-radius: 8px;
    color: var(--gold-light);
    font-size: 16px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold);
}

.form-group input::placeholder {
    color: rgba(255, 248, 220, 0.3);
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--gold-light);
    font-size: 14px;
}

.auth-link a {
    color: var(--gold-primary);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: var(--gold-light);
}

.btn-back {
    position: absolute;
    top: 30px;
    left: 30px;
    padding: 12px 25px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-back:hover {
    background: var(--gold-primary);
    color: var(--black-primary);
    box-shadow: var(--glow-gold);
}

/* ============================================
   LOBBY
   ============================================ */

.lobby-container {
    max-width: 1200px;
    padding: 40px;
    z-index: 2;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gold-dark);
}

.lobby-header h2 {
    font-family: var(--font-title);
    font-size: 42px;
    color: var(--gold-primary);
    text-shadow: var(--glow-gold);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    font-size: 20px;
    font-weight: 600;
    color: var(--gold-light);
}

.points {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-primary);
    padding: 10px 20px;
    background: var(--black-tertiary);
    border-radius: 10px;
    border: 1px solid var(--gold-dark);
}

.btn-logout {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.mode-card {
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
}

.mode-card:hover {
    transform: translateY(-10px);
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold-strong), var(--shadow-deep);
}

.mode-icon {
    font-size: 80px;
    color: var(--gold-primary);
    margin-bottom: 20px;
}

.mode-card h3 {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--gold-primary);
    margin-bottom: 10px;
}

.mode-card p {
    font-size: 16px;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.mode-description {
    font-size: 14px;
    color: rgba(255, 248, 220, 0.6);
    margin-bottom: 30px;
    min-height: 40px;
}

.lobby-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* ============================================
   PANTALLA DE JUEGO
   ============================================ */

#gameScreen {
    display: none;
    flex-direction: column;
    padding: 0;
}

#gameScreen.active {
    display: flex;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border-bottom: 2px solid var(--gold-dark);
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back-game {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-back-game:hover {
    background: var(--gold-primary);
    color: var(--black-primary);
}

.game-mode-indicator {
    padding: 8px 20px;
    background: var(--black-primary);
    border: 1px solid var(--gold-dark);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-primary);
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 20px;
}

.points-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 25px;
    background: var(--black-primary);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
}

.points-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-primary);
}

.points-label {
    font-size: 12px;
    color: var(--gold-light);
    text-transform: uppercase;
}

.money-equivalent {
    font-size: 14px;
    color: var(--gold-light);
    opacity: 0.7;
}

.btn-icon {
    width: 45px;
    height: 45px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--gold-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--gold-primary);
    color: var(--black-primary);
    box-shadow: var(--glow-gold);
}

/* ============================================
   PANEL DE JUGADORES (MULTIJUGADOR)
   ============================================ */

.players-panel {
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border-bottom: 2px solid var(--gold-dark);
    padding: 15px 40px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.players-panel:not(.hidden) {
    max-height: 200px;
}

.players-panel h3 {
    font-size: 16px;
    color: var(--gold-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.players-list {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.player-card {
    background: var(--black-primary);
    border: 1px solid var(--gold-dark);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 200px;
}

.player-card.active {
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold);
}

.player-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 5px;
}

.player-points {
    font-size: 14px;
    color: var(--gold-primary);
}

.player-bet {
    font-size: 12px;
    color: var(--info);
    margin-top: 5px;
}

/* ============================================
   ÁREA PRINCIPAL DEL JUEGO
   ============================================ */

.game-main {
    display: flex;
    gap: 40px;
    padding: 40px;
    flex: 1;
    overflow-y: auto;
}

/* Ruleta */
.roulette-container {
    flex-shrink: 0;
    width: 400px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#rouletteCanvas {
    border-radius: 50%;
    box-shadow: 
        var(--glow-gold),
        var(--shadow-deep),
        inset 0 0 60px rgba(0, 0, 0, 0.9);
}

.ball {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, white, silver);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    display: none;
    z-index: 10;
}

.result-display {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--black-primary) 0%, var(--black-secondary) 100%);
    border: 3px solid var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: var(--gold-primary);
    box-shadow: var(--glow-gold-strong);
    margin-top: 20px;
}

.result-display.red {
    color: var(--red-roulette);
    border-color: var(--red-roulette);
}

.result-display.black {
    color: white;
    border-color: white;
}

.result-display.green {
    color: var(--green-roulette);
    border-color: var(--green-roulette);
}

.spin-status {
    font-size: 18px;
    font-weight: 600;
    color: var(--gold-primary);
    text-align: center;
    padding: 15px 30px;
    background: var(--black-tertiary);
    border: 1px solid var(--gold-dark);
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mesa de apuestas */
.betting-table-container {
    flex: 1;
    background: linear-gradient(135deg, #0F4C29 0%, #1A5C3A 50%, #0F4C29 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-deep);
    max-width: 800px;
}

.table-title {
    font-family: var(--font-title);
    font-size: 24px;
    color: var(--gold-primary);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: var(--glow-gold);
}

.betting-grid {
    display: grid;
    grid-template-columns: 60px 1fr 80px;
    gap: 3px;
    margin-bottom: 10px;
}

/* Celdas de apuesta */
.bet-cell {
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 50px;
    text-align: center;
    padding: 5px;
}

.bet-cell:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    color: var(--black-primary);
    transform: scale(1.05);
    box-shadow: var(--glow-gold);
    z-index: 5;
}

.bet-cell.active {
    border-color: var(--gold-primary);
    box-shadow: var(--glow-gold);
}

.bet-cell.zero {
    grid-row: 1 / 4;
    background: linear-gradient(135deg, var(--green-roulette) 0%, #004d00 100%);
    color: white;
    font-size: 36px;
}

/* Grid de números */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
}

.number-cell {
    aspect-ratio: 1;
    font-size: 16px;
}

.number-cell.red {
    background: linear-gradient(135deg, var(--red-roulette) 0%, #8B0000 100%);
    color: white;
}

.number-cell.black {
    background: linear-gradient(135deg, var(--black-roulette) 0%, #333333 100%);
    color: white;
}

/* Columnas */
.columns {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bet-cell.column {
    flex: 1;
    font-size: 14px;
}

/* Apuestas externas */
.outside-bets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.bet-cell.outside {
    padding: 15px 10px;
    font-size: 14px;
}

.bet-cell.outside.red {
    background: linear-gradient(135deg, var(--red-roulette) 0%, #8B0000 100%);
    color: white;
}

.bet-cell.outside.black {
    background: linear-gradient(135deg, var(--black-roulette) 0%, #333333 100%);
    color: white;
}

/* Docenas */
.dozens {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.bet-cell.dozen {
    padding: 15px;
    font-size: 14px;
}

/* Fichas en las apuestas */
.bet-chip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    background: radial-gradient(circle, var(--gold-primary), var(--gold-dark));
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--black-primary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* ============================================
   PANEL DE CONTROL
   ============================================ */

.control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border-top: 2px solid var(--gold-dark);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
}

.chips-selector h4 {
    font-size: 14px;
    color: var(--gold-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.chips {
    display: flex;
    gap: 10px;
}

.chip {
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, var(--gold-primary), var(--gold-dark));
    border: 4px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--black-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.chip:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--glow-gold-strong);
}

.chip.selected {
    border-color: var(--gold-light);
    box-shadow: var(--glow-gold-strong);
    transform: scale(1.15);
}

.bet-summary {
    text-align: center;
}

.bet-summary h4 {
    font-size: 18px;
    color: var(--gold-primary);
    margin-bottom: 5px;
}

.money-value {
    font-size: 14px;
    color: var(--gold-light);
    opacity: 0.8;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

/* ============================================
   HISTORIAL DE RESULTADOS
   ============================================ */

.results-history {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 15px;
    padding: 20px;
    width: 250px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-deep);
    z-index: 50;
}

.results-history h4 {
    font-size: 16px;
    color: var(--gold-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.recent-results {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid;
}

.result-number.red {
    background: var(--red-roulette);
    color: white;
    border-color: darkred;
}

.result-number.black {
    background: var(--black-roulette);
    color: white;
    border-color: gray;
}

.result-number.green {
    background: var(--green-roulette);
    color: white;
    border-color: darkgreen;
}

/* ============================================
   CHAT (MULTIJUGADOR)
   ============================================ */

.chat-panel {
    position: fixed;
    bottom: 180px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-deep);
    z-index: 50;
}

.chat-panel.hidden {
    display: none;
}

.chat-panel h4 {
    font-size: 16px;
    color: var(--gold-primary);
    padding: 15px;
    border-bottom: 1px solid var(--gold-dark);
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    background: var(--black-primary);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--gold-light);
}

.chat-message .sender {
    font-weight: 600;
    color: var(--gold-primary);
    margin-bottom: 3px;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--gold-dark);
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    padding: 10px;
    background: var(--black-primary);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--gold-light);
    font-size: 13px;
}

.chat-input-container button {
    width: 40px;
    height: 40px;
    background: var(--gold-primary);
    border: none;
    border-radius: 8px;
    color: var(--black-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input-container button:hover {
    background: var(--gold-light);
    box-shadow: var(--glow-gold);
}

/* ============================================
   MODALES
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--glow-gold-strong), var(--shadow-deep);
    animation: fadeInScale 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--gold-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.modal-content h2 {
    font-family: var(--font-title);
    font-size: 32px;
    color: var(--gold-primary);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: var(--glow-gold);
}

.instructions-content, .historial-content {
    color: var(--gold-light);
    line-height: 1.8;
}

.instructions-content section {
    margin-bottom: 30px;
}

.instructions-content h3 {
    font-family: var(--font-elegant);
    font-size: 22px;
    color: var(--gold-primary);
    margin-bottom: 15px;
}

.instructions-content ul, .instructions-content ol {
    margin-left: 25px;
}

.instructions-content li {
    margin-bottom: 10px;
}

.historial-content {
    max-height: 400px;
    overflow-y: auto;
}

.historial-item {
    background: var(--black-primary);
    border: 1px solid var(--gold-dark);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.historial-item.win {
    border-left: 4px solid var(--success);
}

.historial-item.loss {
    border-left: 4px solid var(--danger);
}

/* ============================================
   NOTIFICACIONES TOAST
   ============================================ */

.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--black-secondary) 0%, var(--black-tertiary) 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 15px;
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gold-light);
    box-shadow: var(--glow-gold-strong), var(--shadow-deep);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

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

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast.warning {
    border-color: var(--warning);
    color: var(--warning);
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: var(--glow-gold);
    }
    50% {
        box-shadow: var(--glow-gold-strong);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }
    
    .betting-table-container {
        width: 100%;
        max-width: 100%;
    }
    
    .results-history {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
    
    .chat-panel {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 48px;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .btn-luxury {
        min-width: 250px;
        font-size: 16px;
        padding: 15px 40px;
    }
    
    .auth-box {
        min-width: 350px;
        padding: 30px;
    }
    
    .game-modes {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .chips {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .roulette-container {
        width: 100%;
    }
    
    #rouletteCanvas {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 36px;
    }
    
    .auth-box {
        min-width: 300px;
        padding: 20px;
    }
    
    .lobby-container {
        padding: 20px;
    }
    
    .game-main {
        padding: 20px;
    }
    
    .bet-cell {
        font-size: 14px;
        min-height: 40px;
    }
    
    .chip {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--black-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* ============================================
   UTILIDADES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

.mb-20 {
    margin-bottom: 20px;
}

/* Efectos de carga */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gold-dark);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
