/* 21.jecode.click — table de jeu (PC) */

.game-body {
    background:
        radial-gradient(ellipse 60% 50% at center 55%, rgba(10,20,16,.45) 0%, rgba(10,20,16,.85) 70%, #0a1410 100%),
        url('/assets/decor-bg.jpg') center center / cover no-repeat fixed;
    min-height: 100dvh;
}
.app-header {
    background: rgba(15, 26, 22, .85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.actions {
    background: linear-gradient(to top, #0a1410 60%, rgba(10,20,16,.6) 90%, transparent) !important;
}

/* Header — bankroll badge */
.bankroll-badge {
    display: flex; flex-direction: column; align-items: flex-end;
    margin-left: auto;
    padding: 4px 12px;
    background: linear-gradient(180deg, #14241c, #0c1812);
    border: 1px solid #2c4036;
    border-radius: 8px;
}
.bankroll-badge .l { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; }
.bankroll-badge .v { font-size: 18px; font-weight: 700; color: var(--accent); font-family: 'Georgia', serif; line-height: 1; }

/* === TABLE LAYOUT === */
.table {
    max-width: 1100px; margin: 0 auto;
    padding: 24px 24px 200px;
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 28px;
    min-height: calc(100dvh - 64px);
}

/* Sièges */
.seat {
    display: flex; flex-direction: column;
    align-items: center;
    gap: 14px;
    min-height: 220px;
}
.seat-label {
    display: flex; align-items: center; gap: 14px;
    font-size: 12px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .2em;
    font-weight: 600;
}
.seat-label .hand-value {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 4px 12px; border-radius: 999px;
    font-family: 'Georgia', serif;
    font-size: 18px; font-weight: 700;
    letter-spacing: 0; text-transform: none;
    min-width: 44px; text-align: center;
}
.dealer-seat .seat-label { order: -1; }

/* Main */
.hand {
    display: flex; gap: -50px;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.hand .card {
    margin-left: -55px;
    transform: rotate(-2deg);
}
.hand .card:first-child { margin-left: 0; transform: rotate(0); }
.hand .card:nth-child(odd) { transform: rotate(-2deg); }
.hand .card:nth-child(even) { transform: rotate(2deg); }
.hand .card:nth-child(3) { transform: rotate(-1deg); }

/* === CARTE === */
.card {
    width: 110px; height: 160px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.05) inset;
    position: relative;
    display: flex; flex-direction: column;
    padding: 10px 12px;
    color: #1a1a1a;
    font-family: 'Georgia', serif;
    user-select: none;
    transition: transform .25s ease;
    animation: dealIn .35s ease backwards;
}
@keyframes dealIn {
    from { transform: translateY(-30px) rotate(0); opacity: 0; }
    to { opacity: 1; }
}
.card.red { color: #c11d1d; }
.card .rank-tl, .card .rank-br {
    font-size: 22px; font-weight: 700; line-height: 1;
}
.card .rank-br {
    position: absolute; bottom: 10px; right: 12px;
    transform: rotate(180deg);
    font-size: 22px;
}
.card .suit-tl {
    font-size: 18px; line-height: 1; margin-top: 2px;
}
.card .suit-c {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 56px; line-height: 1;
}
.card.back {
    background: repeating-linear-gradient(45deg, #1a4d3a, #1a4d3a 8px, #163e2f 8px, #163e2f 16px);
    border: 4px solid #fff;
}
.card.back > * { display: none; }

/* === Badge gros "valeur totale" === */
.hand-row {
    display: flex; align-items: center; gap: 18px;
    justify-content: center;
}
.hand-value-big {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; height: 50px; padding: 0 18px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 2px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 22px rgba(201,161,74,.15);
    flex-shrink: 0;
}
.hand-value-big .hv-num {
    font-family: 'Georgia', serif;
    font-size: 28px; font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -.02em;
}
/* États gagnant/perdant héritent des classes parent */
.hand-seat.r-win .hand-value-big, .hand-seat.r-dealer_bust .hand-value-big, .hand-seat.r-blackjack .hand-value-big {
    border-color: #4ec98c;
    box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 26px rgba(78,201,140,.35);
}
.hand-seat.r-win .hv-num, .hand-seat.r-dealer_bust .hv-num, .hand-seat.r-blackjack .hv-num { color: #4ec98c; }
.hand-seat.r-lose .hand-value-big, .hand-seat.r-bust .hand-value-big {
    border-color: var(--danger);
    box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 26px rgba(232,90,90,.3);
}
.hand-seat.r-lose .hv-num, .hand-seat.r-bust .hv-num { color: var(--danger); }
.hand-seat.r-push .hand-value-big { border-color: rgba(201,161,74,.5); }

/* === Multi-mains (joueur) === */
.player-hands {
    display: flex; gap: 32px;
    align-items: flex-start; justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}
.player-hands.multi .hand .card {
    width: 90px; height: 130px;
    padding: 8px 10px;
}
.player-hands.multi .hand .card .rank-tl,
.player-hands.multi .hand .card .rank-br { font-size: 18px; }
.player-hands.multi .hand .card .suit-c   { font-size: 44px; }

.hand-seat {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    padding: 14px 16px 10px;
    border-radius: 14px;
    transition: all .2s;
    border: 1px solid transparent;
    min-width: 220px;
}
.hand-seat.active {
    background: rgba(201,161,74,.06);
    border-color: rgba(201,161,74,.3);
    box-shadow: 0 0 30px rgba(201,161,74,.15);
}
.hand-seat.done { opacity: .55; }
.hand-seat.r-win .hand-value, .hand-seat.r-dealer_bust .hand-value, .hand-seat.r-blackjack .hand-value { color: #4ec98c; border-color: rgba(78,201,140,.4); }
.hand-seat.r-lose .hand-value, .hand-seat.r-bust .hand-value { color: var(--danger); border-color: rgba(232,90,90,.4); }
.hand-seat.r-push .hand-value { color: var(--accent); }

.bet-chip {
    background: linear-gradient(180deg, #c9a14a, #a0782f);
    color: #1a1208;
    font-size: 12px; font-weight: 700;
    padding: 3px 9px; border-radius: 999px;
    display: inline-flex; align-items: baseline; gap: 4px;
    box-shadow: 0 1px 4px rgba(201,161,74,.3);
}
.bet-chip .cur { font-size: 9px; opacity: .7; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* === Pot / message === */
.pot-area {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    min-height: 60px; justify-content: center;
}
.message {
    color: var(--text); font-size: 18px;
    padding: 10px 22px;
    background: rgba(255,255,255,.03);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.06);
}
.message.win    { color: #4ec98c; border-color: rgba(78,201,140,.3); background: rgba(78,201,140,.08); }
.message.lose   { color: var(--danger); border-color: rgba(232,90,90,.3); background: rgba(232,90,90,.08); }
.message.push   { color: var(--accent); border-color: rgba(201,161,74,.3); background: rgba(201,161,74,.08); }
.message.bj     { color: #ffd700; border-color: rgba(255,215,0,.4); background: rgba(255,215,0,.1); font-weight: 700; }

.bet-display {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 13px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .15em;
}
.bet-display .amt { font-size: 22px; color: var(--accent); font-family: 'Georgia', serif; font-weight: 700; }

/* === Actions panel === */
.actions {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, #0a1410 70%, transparent);
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 5;
}

/* Bet panel (IDLE) */
.bet-panel {
    display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.chips { display: flex; gap: 14px; }
.chip {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 4px dashed rgba(255,255,255,.5);
    background: #c11d1d;
    color: #fff;
    font-weight: 700; font-size: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.2) inset;
    transition: all .12s;
}
.chip:hover { transform: translateY(-4px) scale(1.05); }
.chip:active { transform: translateY(-2px) scale(.97); }
.chip-10  { background: linear-gradient(180deg, #4a90e2, #2962a8); }
.chip-25  { background: linear-gradient(180deg, #4ec98c, #2c8a5e); }
.chip-100 { background: linear-gradient(180deg, #1a1a1a, #0a0a0a); }
.chip-500 { background: linear-gradient(180deg, #c11d1d, #841414); }
.chip-clear {
    background: transparent; border: 2px solid var(--border);
    color: var(--muted);
}

.bet-row {
    display: flex; align-items: center; gap: 22px;
}
.bet-current {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 22px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px;
}
.bet-current .lab { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .2em; }
.bet-current .amt { font-size: 26px; color: var(--accent); font-family: 'Georgia', serif; font-weight: 700; line-height: 1.1; }

.btn.big { padding: 16px 38px; font-size: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Play panel (PLAYER) */
.play-panel {
    display: flex; gap: 12px;
}
.btn.play {
    padding: 14px 32px;
    font-size: 14px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .12em;
    background: var(--panel-2); border: 1px solid var(--border);
}
.btn.play:hover { background: #1c2e26; border-color: var(--accent-2); color: var(--accent); }
.btn.play:disabled { opacity: .35; cursor: not-allowed; }

/* === Modale règles === */
.help-modal {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    max-width: 600px; width: calc(100vw - 32px);
    max-height: 88vh;
}
.help-modal::backdrop { background: rgba(0,0,0,.7); }
.help-inner {
    padding: 28px 28px 32px;
    overflow-y: auto;
    max-height: 88vh;
}
.help-modal h2 {
    font-family: 'Georgia', serif;
    color: var(--accent);
    font-size: 24px;
    margin-bottom: 18px;
    letter-spacing: -.01em;
}
.help-modal h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: var(--accent-2);
    margin: 18px 0 8px;
    font-weight: 700;
}
.help-modal p { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 6px; }
.help-modal ul { font-size: 14px; line-height: 1.6; padding-left: 20px; color: var(--text); }
.help-modal ul li { margin-bottom: 4px; }
.help-modal kbd {
    display: inline-block; padding: 2px 7px;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px;
    font-family: ui-monospace, monospace; font-size: 12px;
    color: var(--accent);
}
.help-close {
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 50%;
    background: transparent; color: var(--muted);
    border: 1px solid var(--border);
    cursor: pointer; font-size: 14px;
}
.help-close:hover { background: var(--panel-2); color: var(--text); }

/* === Reward modal (vidéo) === */
.reward-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 100;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.reward-modal.active { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reward-inner {
    position: relative;
    max-width: min(90vw, 1280px);
    max-height: 90vh;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.reward-content {
    max-width: 100%; max-height: 80vh;
    display: flex; align-items: center; justify-content: center;
}
.reward-content img,
.reward-content video {
    max-width: 100%; max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.reward-close {
    position: absolute; top: -10px; right: -10px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: all .15s;
    z-index: 2;
}
.reward-close:hover { background: var(--panel-2); border-color: var(--accent); }
.reward-result {
    color: var(--accent); font-family: 'Georgia', serif;
    font-size: 26px; font-weight: 700;
    text-shadow: 0 2px 12px rgba(201,161,74,.4);
}
