/* ═══════════════════════════════════════════
   Rixe de Paname Casino — Discord Theme
   ═══════════════════════════════════════════ */
:root {
    --bg-primary: #05050A;
    --bg-secondary: #11111A;
    --bg-card: rgba(18, 18, 28, 0.65);
    --bg-card-hover: rgba(26, 26, 40, 0.8);
    --bg-input: rgba(10, 10, 15, 0.8);
    --border: rgba(255,255,255,0.05);
    --border-glow: rgba(88,101,242,0.5);
    --text-primary: #ffffff;
    --text-secondary: #a3a6aa;
    --text-muted: #5b5e66;
    --accent: #5865F2;
    --accent-hover: #6974fa;
    --gold: #FFD700;
    --gold-dark: #ccaa00;
    --green: #00E676;
    --red: #FF3B30;
    --orange: #FF9F0A;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 10px 40px rgba(0,0,0,0.6);
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
    font-family: var(--font);
    background: radial-gradient(circle at 50% 0%, #1c1c2e 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

/* ═══ LOGIN SCREEN ═══ */
.screen { min-height: 100vh; }
.login-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px; position: relative;
}
.login-glow {
    position: absolute; top: 50%; left: 50%; width: 500px; height: 500px;
    transform: translate(-50%,-50%);
    background: radial-gradient(circle, rgba(88,101,242,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 48px 40px; text-align: center;
    max-width: 420px; width: 100%; position: relative; z-index: 1;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}
.login-logo { font-size: 64px; margin-bottom: 16px; }
.login-title {
    font-size: 28px; font-weight: 900; letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--gold) 0%, #FFA500 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-subtitle {
    font-size: 16px; color: var(--text-secondary); margin-bottom: 32px;
    text-transform: uppercase; letter-spacing: 4px; font-weight: 600;
}
.login-error {
    background: rgba(240,71,71,0.1); border: 1px solid rgba(240,71,71,0.3);
    border-radius: var(--radius-sm); padding: 12px; margin-bottom: 20px;
    color: var(--red); font-size: 14px;
}
.btn-discord {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
    padding: 14px 28px; font-size: 16px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all 0.2s;
    font-family: var(--font);
}
.btn-discord:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(88,101,242,0.4); }
.btn-discord svg { flex-shrink: 0; }

/* ═══ HEADER ═══ */
#header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: rgba(14,14,22,0.8);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 28px; }
.header-title {
    font-size: 18px; font-weight: 800;
    background: linear-gradient(135deg, var(--gold), #FFA500);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 16px; }
.header-balance {
    display: flex; flex-direction: column; align-items: flex-end;
    background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.15);
    border-radius: var(--radius-sm); padding: 6px 14px;
}
.balance-label { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.balance-value { font-size: 16px; font-weight: 700; color: var(--gold); }
.header-rank {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
}
.header-user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); }
#user-name { font-size: 14px; font-weight: 600; }
.btn-logout {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(240,71,71,0.15); color: var(--red);
    text-decoration: none; font-size: 14px; font-weight: 700;
    transition: all 0.2s;
}
.btn-logout:hover { background: var(--red); color: #fff; }

/* ═══ NAVIGATION ═══ */
#game-nav {
    display: flex; gap: 4px; padding: 12px 24px;
    overflow-x: auto; scrollbar-width: none;
    background: rgba(14,14,22,0.5); border-bottom: 1px solid var(--border);
}
#game-nav::-webkit-scrollbar { display: none; }
.nav-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary); font-size: 14px;
    font-weight: 600; cursor: pointer; white-space: nowrap;
    font-family: var(--font); transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-btn.active {
    background: rgba(88,101,242,0.15); color: var(--accent);
    border-color: rgba(88,101,242,0.3);
}
.nav-icon { font-size: 18px; }

/* ═══ MAIN CONTENT ═══ */
#main-content {
    max-width: 700px; margin: 0 auto; padding: 24px;
    min-height: calc(100vh - 130px);
}
.game-panel { display: none; animation: fadeIn 0.3s ease; }
.game-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.game-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: relative; overflow: hidden;
}
.game-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.game-title {
    font-size: 24px; font-weight: 900; margin-bottom: 28px;
    text-align: center; letter-spacing: -0.5px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.game-result {
    text-align: center; min-height: 40px; padding: 10px;
    font-size: 16px; font-weight: 600; border-radius: var(--radius-sm);
    margin: 16px 0; transition: all 0.3s;
}
.game-result.win { background: rgba(67,181,129,0.12); color: var(--green); }
.game-result.lose { background: rgba(240,71,71,0.12); color: var(--red); }
.game-result.push { background: rgba(250,166,26,0.12); color: var(--orange); }

/* ═══ BET CONTROLS ═══ */
.bet-controls { display: flex; flex-direction: column; gap: 12px; }
.bet-input-group { display: flex; flex-direction: column; gap: 4px; }
.bet-input-group label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.bet-input {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    color: var(--text-primary); font-size: 18px; font-weight: 700;
    font-family: var(--font); width: 100%; outline: none; transition: border 0.2s;
}
.bet-input:focus { border-color: var(--accent); }
.bet-input::placeholder { color: var(--text-muted); }
.bet-presets { display: flex; gap: 8px; }
.preset-btn {
    flex: 1; padding: 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: rgba(255,255,255,0.03);
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font); transition: all 0.2s;
}
.preset-btn:hover { background: rgba(88,101,242,0.15); color: var(--accent); border-color: rgba(88,101,242,0.3); }
.btn-play {
    padding: 16px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent) 0%, #8793FF 100%);
    color: #fff; font-size: 16px; font-weight: 900; letter-spacing: 2px;
    cursor: pointer; font-family: var(--font); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase; position: relative; overflow: hidden;
    box-shadow: 0 4px 15px rgba(88,101,242,0.3);
}
.btn-play::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg); transition: 0.5s;
}
.btn-play:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(88,101,242,0.5); }
.btn-play:hover::after { left: 150%; }
.btn-play:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(88,101,242,0.3); }
.btn-play:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ═══ SLOTS ═══ */
.slots-machine { text-align: center; margin-bottom: 16px; }
.slots-frame {
    display: inline-flex; gap: 12px; padding: 20px 28px;
    background: var(--bg-input); border: 2px solid var(--border);
    border-radius: var(--radius); box-shadow: inset 0 4px 12px rgba(0,0,0,0.3);
}
.slot-reel {
    width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
    font-size: 46px; background: rgba(0,0,0,0.3); border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08); transition: all 0.3s;
    box-shadow: inset 0 6px 15px rgba(0,0,0,0.4), 0 2px 5px rgba(255,255,255,0.02);
}
.slot-reel.spin { animation: slotSpin 0.3s linear infinite; filter: blur(2px) contrast(1.2); }
@keyframes slotSpin {
    0% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
    100% { transform: translateY(0); }
}

/* ═══ COINFLIP ═══ */
.coinflip-area { text-align: center; margin-bottom: 16px; perspective: 600px; }
.coin {
    width: 100px; height: 100px; margin: 0 auto; position: relative;
    transform-style: preserve-3d; transition: transform 0.8s ease;
}
.coin.flip { animation: coinFlip 1s ease-in-out; }
.coin.flip-face { animation: coinFlipFace 1s ease-in-out; }
.coin-front, .coin-back {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 42px; font-weight: 900; backface-visibility: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 10px 30px rgba(0,0,0,0.6);
}
.coin-front { background: radial-gradient(circle at 30% 30%, #FFE066, var(--gold), #B8860B); color: #222; text-shadow: 0 1px 2px rgba(255,255,255,0.5); }
.coin-back {
    background: radial-gradient(circle at 30% 30%, #E0E0E0, #A0A0A0, #606060);
    color: #222; transform: rotateY(180deg); text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
@keyframes coinFlip { 0%{transform:rotateY(0)} 100%{transform:rotateY(1080deg)} }
@keyframes coinFlipFace { 0%{transform:rotateY(0)} 100%{transform:rotateY(1260deg)} }
.coinflip-choices { display: flex; gap: 8px; }
.choice-btn {
    flex: 1; padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: rgba(255,255,255,0.03);
    color: var(--text-secondary); font-size: 15px; font-weight: 700;
    cursor: pointer; font-family: var(--font); transition: all 0.2s;
}
.choice-btn.active { background: rgba(88,101,242,0.2); color: var(--accent); border-color: var(--accent); }
.choice-btn:hover { background: rgba(255,255,255,0.06); }

/* ═══ DICE ═══ */
.dice-area { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.die {
    width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
    font-size: 42px; background: var(--bg-input); border: 2px solid var(--border);
    border-radius: var(--radius-sm); transition: all 0.3s;
}
.die.roll { animation: diceRoll 0.6s ease; }
@keyframes diceRoll {
    0% { transform: rotate(0); } 25% { transform: rotate(15deg) scale(1.1); }
    50% { transform: rotate(-10deg); } 75% { transform: rotate(5deg); }
    100% { transform: rotate(0); }
}
.dice-prediction { text-align: center; margin-bottom: 12px; }
.dice-prediction label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.dice-prediction input[type="range"] {
    width: 100%; accent-color: var(--accent);
    background: transparent; cursor: pointer;
}
.pred-value {
    display: inline-block; min-width: 32px; text-align: center;
    font-size: 24px; font-weight: 800; color: var(--accent);
}

/* ═══ ROULETTE ═══ */
.roulette-result-display { text-align: center; margin-bottom: 16px; }
.roulette-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; border-radius: 50%;
    font-size: 32px; font-weight: 900;
    background: var(--bg-input); border: 3px solid var(--border);
    transition: all 0.5s;
}
.roulette-number.rouge { border-color: var(--red); color: var(--red); background: rgba(240,71,71,0.1); }
.roulette-number.noir { border-color: #aaa; color: #ddd; background: rgba(255,255,255,0.05); }
.roulette-number.vert { border-color: var(--green); color: var(--green); background: rgba(67,181,129,0.1); }
.roulette-bets { display: flex; flex-wrap: wrap; gap: 6px; }
.rbet-btn {
    flex: 1; min-width: calc(33% - 4px); padding: 10px 6px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03); color: var(--text-secondary);
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: var(--font); transition: all 0.2s;
}
.rbet-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(88,101,242,0.15); }
.rbet-btn:hover { background: rgba(255,255,255,0.06); }
.roulette-custom { display: flex; }
.roulette-custom .bet-input { text-align: center; }

/* ═══ BLACKJACK ═══ */
.bj-table { text-align: center; margin-bottom: 16px; }
.bj-hand { margin-bottom: 12px; }
.bj-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.bj-cards { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 60px; }
.bj-card {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 68px; border-radius: 6px; font-size: 16px; font-weight: 800;
    background: #fff; color: #333; border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: all 0.3s;
    animation: cardDeal 0.3s ease;
}
.bj-card.red { color: var(--red); }
.bj-card.hidden-card { background: linear-gradient(135deg, var(--accent), #7289DA); color: #fff; }
@keyframes cardDeal { from { transform: translateY(-20px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
.bj-value { font-size: 18px; font-weight: 700; margin-top: 8px; }
.bj-vs { font-size: 14px; color: var(--text-muted); font-weight: 800; margin: 8px 0; }
.bj-actions { display: flex; gap: 12px; justify-content: center; }
.btn-hit { background: linear-gradient(135deg, var(--green), #36a374); }
.btn-stand { background: linear-gradient(135deg, var(--orange), #e6951a); }

/* ═══ CRASH ═══ */
.crash-display { position: relative; text-align: center; margin-bottom: 16px; }
#crash-canvas {
    width: 100%; max-width: 600px; height: 250px;
    background: rgba(0,0,0,0.2); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.3);
}
.crash-multiplier {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 48px; font-weight: 900; color: var(--green);
    text-shadow: 0 0 30px rgba(67,181,129,0.4);
    pointer-events: none; transition: color 0.3s;
}
.crash-multiplier.crashed { color: var(--red); text-shadow: 0 0 30px rgba(240,71,71,0.4); }
.btn-cashout {
    width: 100%; padding: 16px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--green), #36a374);
    color: #fff; font-size: 18px; font-weight: 800;
    cursor: pointer; font-family: var(--font); transition: all 0.2s;
    text-transform: uppercase; letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(67,181,129,0.4)} 50%{box-shadow:0 0 0 12px rgba(67,181,129,0)} }
.btn-cashout:hover { transform: translateY(-2px); }

/* ═══ LEADERBOARD ═══ */
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--border);
    border-radius: var(--radius-sm); transition: all 0.2s;
}
.lb-row:hover { background: rgba(255,255,255,0.04); }
.lb-medal { font-size: 22px; min-width: 32px; text-align: center; }
.lb-rank-num { font-size: 14px; font-weight: 800; color: var(--text-muted); min-width: 32px; text-align: center; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; }
.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 700; }
.lb-stats { font-size: 12px; color: var(--text-muted); }
.lb-rank-badge { font-size: 18px; }

/* ═══ TOAST ═══ */
#toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; max-width: 380px;
    animation: toastIn 0.3s ease; box-shadow: var(--shadow);
}
.toast.success { background: rgba(67,181,129,0.9); color: #fff; }
.toast.error { background: rgba(240,71,71,0.9); color: #fff; }
.toast.info { background: rgba(88,101,242,0.9); color: #fff; }
.toast.rank-up {
    background: linear-gradient(135deg, rgba(255,215,0,0.95), rgba(255,165,0,0.95));
    color: #333; font-size: 16px;
}
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .header-title { display: none; }
    .header-user #user-name { display: none; }
    #header { padding: 8px 12px; }
    .header-right { gap: 8px; }
    .balance-value { font-size: 14px; }
    #game-nav { padding: 8px 12px; gap: 2px; }
    .nav-btn { padding: 8px 12px; font-size: 12px; }
    .nav-text { display: none; }
    .nav-icon { font-size: 20px; }
    #main-content { padding: 12px; }
    .game-card { padding: 20px 16px; }
    .game-title { font-size: 18px; }
    .slot-reel { width: 56px; height: 56px; font-size: 32px; }
    .crash-multiplier { font-size: 36px; }
    .coin { width: 80px; height: 80px; }
    .coin-front, .coin-back { font-size: 28px; }
    #toast-container { bottom: 12px; right: 12px; left: 12px; }
    .toast { max-width: 100%; }
}
@media (max-width: 420px) {
    .header-rank { display: none; }
    .bet-presets { flex-wrap: wrap; }
    .preset-btn { min-width: calc(50% - 4px); }
    .rbet-btn { min-width: calc(50% - 4px); }
}

