body { background-color: #121212; color: #ffffff; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; text-align: center; padding: 20px; margin: 0; position: relative; min-height: 100vh;}
.hidden { display: none !important; }
.highlight-text { color: #f1c40f; font-weight: bold; }

/* HEADER & TITRE */
#top-header { position: absolute; top: 20px; right: 20px; background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 8px; border: 1px solid #333; font-size: 0.9em; z-index: 100;}
.floating-title { color: #f1c40f; text-transform: uppercase; letter-spacing: 4px; font-size: 3em; margin: 30px 0; animation: floatTitle 3s ease-in-out infinite; }
@keyframes floatTitle { 0%, 100% { transform: translateY(0); text-shadow: 0 0 15px rgba(241, 196, 15, 0.6); } 50% { transform: translateY(-10px); text-shadow: 0 0 30px rgba(241, 196, 15, 1), 0 0 40px #e67e22; } }

input, select { padding: 8px; border-radius: 5px; border: none; background-color: #333; color: white; text-align: center; font-weight: bold; font-family: inherit;}
.btn { padding: 10px 20px; margin: 5px; border-radius: 5px; border: none; background-color: #f1c40f; color: #121212; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn:hover { background-color: #d4ac0d; }
.btn-secondary { background-color: #3498db; color: white; }
.btn-secondary:hover { background-color: #2980b9; }
.btn-small { padding: 5px 10px; background-color: #e74c3c; color: white; border: none; border-radius: 3px; cursor: pointer; font-size: 1.1em;}

.balance-board { background-color: #2c3e50; padding: 15px; border-radius: 10px; display: inline-block; margin: 20px 0; border: 2px solid #f1c40f; }

/* NOUVEAU MENU TUILES */
.games-menu-tiles { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 20px;}
.game-tile-wrapper { display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;}
.tile-title { color: #e67e22; margin: 0; font-size: 1.5em; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); transition: 0.3s;}
.game-tile { width: 220px; height: 220px; background-size: cover; background-position: center; border-radius: 20px; border: 4px solid #333; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 20px rgba(0,0,0,0.5);}
.game-tile-wrapper:hover .game-tile { transform: translateY(-15px) scale(1.05) rotateX(10deg); border-color: #e67e22; box-shadow: 0 20px 40px rgba(230, 126, 34, 0.6);}
.game-tile-wrapper:hover .tile-title { color: #f1c40f; text-shadow: 0 0 15px #e67e22;}

/* ==========================================
   --- SLOT LAYOUT (CORRIGÉ ET ALIGNÉ) ---
   ========================================== */
.slot-layout { 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; 
    gap: 20px; 
    flex-wrap: nowrap; /* Empêche de passer à la ligne */
    margin-top: 20px; 
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Colonnes gauche (Paytable) et droite (Gains) */
.left-column, .right-column { 
    display: flex; 
    flex-direction: column; 
    width: 250px; 
    flex-shrink: 0; /* Empêche l'écrasement */
}

/* Centre (La machine) */
.slot-machine-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 500px; 
    flex-shrink: 0; 
}

.slot-header { display: flex; justify-content: flex-end; align-items: center; width: 100%; padding: 0 10px; margin-bottom: 10px; box-sizing: border-box; }
.live-balance { background: #2ecc71; color: #121212; padding: 5px 15px; border-radius: 20px; font-weight: bold; font-size: 1.1em; box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }

.paytable-section { background-color: #1a1a1a; padding: 15px; border-radius: 10px; border: 2px solid #555; width: 100%; box-sizing: border-box; text-align: left; }
.paytable-section h3 { margin-top: 0; color: #f1c40f; text-align: center; border-bottom: 1px solid #333; padding-bottom: 10px;}
.paytable-grid { display: flex; flex-direction: column; gap: 8px; }
.paytable-row { display: flex; align-items: center; justify-content: space-between; background: #222; padding: 5px 10px; border-radius: 5px;}
.paytable-sym { width: 30px; height: 30px; object-fit: contain; }
.paytable-vals { font-size: 0.85em; color: #ccc; }
.paytable-rules { margin-top: 15px; font-size: 0.8em; color: #999; text-align: center; background: #111; padding: 10px; border-radius: 5px; display: flex; flex-direction: column; gap: 10px;}
.special-symbol-rule { display: flex; align-items: center; gap: 10px; text-align: left;}
.special-symbol-rule p { margin: 0; flex: 1; font-size: 0.9em; }

.win-display-scroll { display: flex; flex-direction: column; gap: 10px; max-height: 450px; overflow-y: auto; padding-right: 5px; }
.win-display-scroll::-webkit-scrollbar { width: 5px; }
.win-display-scroll::-webkit-scrollbar-thumb { background: #555; border-radius: 5px; }
.win-line-box { background: #111; padding: 10px; border-radius: 8px; text-align: center; border: 1px solid #333; }
.win-line-box span { display: block; color: #2ecc71; font-weight: bold; margin-bottom: 8px; font-size: 0.9em; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 120px; margin: 0 auto; }
.mini-dot { aspect-ratio: 1; background: #222; border-radius: 3px; }
.mini-dot.active { background: #f1c40f; box-shadow: 0 0 5px #f1c40f; }
.empty-win-msg { color: #555; font-style: italic; text-align: center; margin-top: 20px; }

.slot-machine.dark-theme { background-color: #0a0a0a; padding: 20px; border-radius: 15px; border: 3px solid #f1c40f; box-shadow: 0 0 30px rgba(241, 196, 15, 0.2); width: 100%; box-sizing: border-box;}

.slot-window { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; background-color: #000; padding: 10px; border-radius: 10px; border-top: 4px solid #222; border-bottom: 4px solid #444; height: 260px; overflow: hidden; position: relative; width: 100%; box-sizing: border-box; }

#big-win-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 50; display: flex; justify-content: center; align-items: center; }
.win-text-container { text-align: center; animation: epicZoom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.win-text-container h3 { color: #fff; margin: 0; font-size: 1.8em; text-transform: uppercase; letter-spacing: 5px; }
#big-win-amount { color: #f1c40f; font-size: 3.5em; margin: 0; font-weight: bold; text-shadow: 0 0 20px #f1c40f, 0 0 40px #e67e22; }
@keyframes epicZoom { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.reel-container { width: 80px; height: 240px; background-color: #151515; border-radius: 5px; box-shadow: inset 0 0 20px rgba(0,0,0,1); flex-shrink: 0;}
.reel-strip { display: flex; flex-direction: column; width: 100%; }
.symbol { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.symbol img { width: 65px; height: 65px; object-fit: contain; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.8)); transition: 0.3s; }
.symbol.dimmed { opacity: 0.2; filter: grayscale(100%); transition: 0.3s; }
.symbol.winning-sym { opacity: 1 !important; filter: none !important; z-index: 5; position: relative; }
.symbol.winning-sym img { filter: drop-shadow(0 0 10px #2ecc71) drop-shadow(0 0 20px #2ecc71); animation: winBreathingPulse 1.2s ease-in-out infinite; }
@keyframes winBreathingPulse { 0% { transform: scale(1.0); filter: drop-shadow(0 0 10px #2ecc71) drop-shadow(0 0 20px #2ecc71); } 50% { transform: scale(1.15); filter: drop-shadow(0 0 15px #2ecc71) drop-shadow(0 0 30px #2ecc71) drop-shadow(0 0 40px #2ecc71); } 100% { transform: scale(1.0); filter: drop-shadow(0 0 10px #2ecc71) drop-shadow(0 0 20px #2ecc71); } }

.master-controls { display: flex; flex-direction: column; gap: 15px; width: 100%; }
.bet-panel { background: #1a1a1a; padding: 15px; border-radius: 10px; border: 1px solid #333; display: flex; flex-direction: column; gap: 10px; }
.bet-display { display: flex; justify-content: space-between; align-items: center; }
.bet-display label { color: #aaa; font-weight: bold; font-size: 1.1em; }
.bet-display input { width: 100%; max-width: 150px; font-size: 1.2em; padding: 10px; }
.bet-buttons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.btn-bet, .btn-bj-bet { background: #333; color: white; border: none; padding: 8px 0; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s;}
.btn-bet:hover, .btn-bj-bet:hover { background: #f1c40f; color: #121212; }
.action-panel { display: flex; justify-content: space-between; gap: 10px; }
.spin-btn { background-color: #e74c3c; color: white; font-size: 1.5em; padding: 15px; flex: 1; margin: 0; box-shadow: 0 4px 0 #c0392b; border-radius: 10px;}
.auto-spin-group { display: flex; flex-direction: column; gap: 5px; width: 120px; }
.auto-btn { background-color: #3498db; margin: 0; padding: 10px; width: 100%;}
.stop-btn { background-color: #e67e22 !important; margin: 0; padding: 10px; width: 100%;}
.fs-msg { color: #9b59b6; font-weight: bold; font-size: 1.2em; text-transform: uppercase; animation: fsPulse 1s infinite alternate;}
@keyframes fsPulse { 0% { transform: scale(1); } 100% { transform: scale(1.05); } }

/* ==========================================
   --- ROULETTE ---
   ========================================== */
.roulette-game-area { background-color: #0a0a0a; padding: 25px; border-radius: 15px; border: 3px solid #27ae60; box-shadow: 0 0 30px rgba(39, 174, 96, 0.2); max-width: 900px; margin: 0 auto;}
.roulette-history-container { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; background: #111; padding: 10px; border-radius: 10px; border: 1px solid #222;}
.roulette-history { display: flex; gap: 5px; }
.hist-item { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: bold; color: white; font-size: 0.9em; box-shadow: 0 2px 4px rgba(0,0,0,0.5);}

.roulette-wheel-wrapper { position: relative; width: 340px; height: 340px; margin: 0 auto 20px; border-radius: 50%; border: 18px solid #5c3a21; box-shadow: 0 0 20px rgba(0,0,0,0.9), inset 0 0 20px rgba(0,0,0,0.9); background: #111; }
.wheel-pointer { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 25px solid #f1c40f; z-index: 20; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.8)); }
.roulette-wheel { width: 100%; height: 100%; border-radius: 50%; position: relative; transition: transform 5s cubic-bezier(0.15, 0.85, 0.2, 1); transform-origin: center center; }
.wheel-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 130px; height: 130px; background: radial-gradient(circle, #b8860b, #5c3a21); border-radius: 50%; border: 5px solid #f1c40f; z-index: 10; box-shadow: 0 0 20px rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; }
#roulette-winner-text { font-size: 3em; font-weight: bold; color: white; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }

.wheel-pocket { box-sizing: border-box; position: absolute; top: 0; left: 50%; transform-origin: 50% 100%; width: 30px; height: 50%; margin-left: -15px; clip-path: polygon(0 0, 100% 0, 50% 100%); display: flex; justify-content: center; padding-top: 5px; font-weight: bold; font-size: 13px; color: white; user-select: none; }
.pocket-red { background-color: #e74c3c; }
.pocket-black { background-color: #2c3e50; }
.pocket-green { background-color: #27ae60; }

.roulette-table-wrapper { display: flex; background: #1e8449; padding: 10px; border-radius: 10px; border: 2px solid #145a32; margin-bottom: 25px; gap: 4px; box-shadow: inset 0 0 20px rgba(0,0,0,0.5);}
.zero-column { display: flex; flex-direction: column; width: 60px; gap: 4px; }
.main-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(5, 50px); gap: 4px; flex: 1; }

.r-cell { display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 1.1em; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); position: relative; user-select: none; border-radius: 4px; transition: 0.2s;}
.r-cell:hover { filter: brightness(1.2); }
.r-red { background-color: #e74c3c; }
.r-black { background-color: #2c3e50; }
.r-green { background-color: #27ae60; }
.r-special { background-color: transparent; border: 2px solid rgba(255,255,255,0.5); font-size: 0.9em; text-transform: uppercase;}

.bet-target { position: absolute; z-index: 5; display: flex; justify-content: center; align-items: center; }
.bet-target:hover { background: rgba(241, 196, 15, 0.5); border-radius: 50%; }
.split-h { right: -6px; top: 15%; height: 70%; width: 10px; }
.split-v { top: -6px; left: 15%; width: 70%; height: 10px; }
.corner { top: -8px; right: -8px; width: 14px; height: 14px; z-index: 6; border-radius: 50%; }

.r-0 { flex: 1; border-radius: 10px 0 0 0; font-size: 1.5em; border: 2px solid #fff;}
.r-00 { flex: 1; border-radius: 0 0 0 10px; font-size: 1.5em; border: 2px solid #fff;}
.r-1st12 { grid-row: 4; grid-column: 1 / span 4; }
.r-2nd12 { grid-row: 4; grid-column: 5 / span 4; }
.r-3rd12 { grid-row: 4; grid-column: 9 / span 4; }
.r-1to18 { grid-row: 5; grid-column: 1 / span 2; }
.r-even { grid-row: 5; grid-column: 3 / span 2; }
.r-red-bet { grid-row: 5; grid-column: 5 / span 2; background-color: #e74c3c; border: 2px solid #c0392b;}
.r-black-bet { grid-row: 5; grid-column: 7 / span 2; background-color: #2c3e50; border: 2px solid #1a252f;}
.r-odd { grid-row: 5; grid-column: 9 / span 2; }
.r-19to36 { grid-row: 5; grid-column: 11 / span 2; }

.placed-chip { position: absolute; background: #f1c40f; color: #000; border-radius: 50%; width: 32px; height: 32px; display: flex; justify-content: center; align-items: center; font-size: 0.8em; font-weight: bold; border: 3px dashed #000; box-shadow: 2px 2px 5px rgba(0,0,0,0.5); z-index: 10; pointer-events: none;}

.roulette-controls { display: flex; flex-direction: column; gap: 15px; }
.chip-selector { display: flex; gap: 15px; justify-content: center; background: #1a1a1a; padding: 15px; border-radius: 10px; border: 1px solid #333;}
.chip { width: 55px; height: 55px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 1.1em; cursor: pointer; border: 4px dashed rgba(255,255,255,0.5); transition: 0.2s; box-shadow: inset 0 0 10px rgba(0,0,0,0.5);}
.chip.active { transform: scale(1.15); box-shadow: 0 0 20px #f1c40f; border-color: #f1c40f; z-index: 5;}
.chip-10 { background: #3498db; color: white;}
.chip-50 { background: #e67e22; color: white;}
.chip-100 { background: #9b59b6; color: white;}
.chip-500 { background: #f1c40f; color: black; border-color: black;}
.chip-1000 { background: #e74c3c; color: white;}
.roulette-actions { display: flex; gap: 10px; }
.roulette-actions button { flex: 1; padding: 15px; font-size: 1.1em; border-radius: 10px; font-weight: bold;}

/* ==========================================
   --- BLACKJACK ---
   ========================================== */
.bj-game-area { background-color: #0a0a0a; padding: 25px; border-radius: 15px; border: 3px solid #2980b9; box-shadow: 0 0 30px rgba(41, 128, 185, 0.2); max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;}
.bj-table { background: radial-gradient(circle at center, #1e8449 0%, #145a32 100%); border-radius: 100px / 50px; padding: 40px 20px; border: 10px solid #5c3a21; box-shadow: inset 0 0 40px rgba(0,0,0,0.8); min-height: 350px; display: flex; flex-direction: column; justify-content: space-between; }
.bj-dealer-area, .bj-player-area { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.bj-score { background: rgba(0,0,0,0.7); padding: 5px 15px; border-radius: 20px; font-weight: bold; color: white; border: 1px solid rgba(255,255,255,0.2); }
.bj-cards-container { display: flex; justify-content: center; min-height: 120px; padding-left: 40px; }

/* ANIMATION DISTRIBUTION BLACKJACK */
@keyframes slideAndFlip { 
    0% { transform: translateY(150px) rotateY(90deg) scale(0.8); opacity: 0; } 
    50% { transform: translateY(-10px) rotateY(45deg) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) rotateY(0deg) scale(1); opacity: 1; } 
}

@keyframes slideHidden { 
    0% { transform: translateY(150px) scale(0.8); opacity: 0; } 
    50% { transform: translateY(-10px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; } 
}

.bj-card { width: 80px; height: 115px; background: white; border-radius: 8px; border: 1px solid #ccc; display: flex; flex-direction: column; justify-content: space-between; padding: 5px; box-sizing: border-box; font-weight: bold; font-size: 1.2em; box-shadow: -4px 4px 10px rgba(0,0,0,0.5); position: relative; margin-left: -40px; transition: transform 0.3s;}
.bj-card.red { color: #e74c3c; }
.bj-card.black { color: #2c3e50; }
.bj-card.hidden-card { background: repeating-linear-gradient(45deg, #2980b9, #2980b9 10px, #3498db 10px, #3498db 20px); border: 2px solid white; color: transparent;}
.bj-card .suit-top { align-self: flex-start; line-height: 1;}
.bj-card .suit-bottom { align-self: flex-end; transform: rotate(180deg); line-height: 1;}
.bj-card .val-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5em; opacity: 0.15;}

.bj-anim-new-card { animation: slideAndFlip 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.bj-anim-new-hidden { animation: slideHidden 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }