/* ── Baccarat Game Styles ──────────────────────────── */

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

.container {
    max-width: 1000px !important;
    overflow: visible !important;
}

#game-wrapper {
    width: 960px;
    height: 640px;
    background: linear-gradient(135deg, #1a5c3a, #145230);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ── Header ──────────────────────────────────────── */
.bacc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: rgba(0,0,0,0.15);
    color: #fff;
}
.bacc-header h1 {
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.bacc-bankroll {
    font-size: 18px;
    font-weight: 600;
}
.bacc-bankroll span { color: #f1c40f; }
.bacc-commission {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-left: 8px;
}
.bacc-commission span { color: #e74c3c; }

.btn-hints {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 5px 14px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-hints:hover { background: rgba(255,255,255,0.35); }
.btn-hints.active { background: #3498db; border-color: #3498db; }

/* ── Table Area ──────────────────────────────────── */
.bacc-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 24px;
    height: calc(100% - 48px);
    justify-content: space-between;
}

/* ── Hands Row ───────────────────────────────────── */
.hands-row {
    display: flex;
    justify-content: center;
    gap: 48px;
    width: 100%;
}

/* ── Card Areas ──────────────────────────────────── */
.hand-area {
    text-align: center;
    min-height: 100px;
    position: relative;
    border-radius: 12px;
    padding: 4px 12px 8px;
    width: 380px;
    background: rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.1);
}
.hand-area.winner-glow {
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241,196,15,0.4);
}
.hand-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.hand-value {
    font-size: 22px;
    font-weight: 700;
    color: #f1c40f;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-bottom: 4px;
    min-height: 28px;
}
.cards-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 96px;
    align-items: flex-end;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    width: 68px;
    height: 96px;
    border-radius: 8px;
    position: relative;
    perspective: 600px;
    flex-shrink: 0;
}
.card-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transform-style: preserve-3d;
    position: relative;
}
.card-face, .card-back {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    position: absolute;
    top: 0; left: 0;
    backface-visibility: hidden;
}
.card-face {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.card-rank {
    font-size: 22px;
    line-height: 1;
}
.card-suit {
    font-size: 24px;
    line-height: 1;
}
.card-corner {
    position: absolute;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
}
.card-corner.top { top: 4px; left: 5px; }
.card-corner.bottom { bottom: 4px; right: 5px; transform: rotate(180deg); }

.card-face.red { color: #e74c3c; }
.card-face.black { color: #2c3e50; }

.card-back {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-back::after {
    content: '\2660';
    font-size: 28px;
    color: rgba(255,255,255,0.3);
}

/* ── Hint Panel ──────────────────────────────────── */
.hint-panel {
    background: #ebf5fb;
    border-left: 4px solid #3498db;
    border-radius: 6px;
    padding: 5px 12px 6px;
    max-width: 460px;
    margin: 0 auto;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-align: left;
}
.hint-panel.visible { display: block; }
.hint-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.hint-action {
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
}
.hint-risk {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    color: #fff;
    white-space: nowrap;
}
.hint-risk.risk-good { background: #27ae60; }
.hint-risk.risk-ok   { background: #f39c12; }
.hint-risk.risk-bad  { background: #e74c3c; }
.hint-explanation {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}
.hint-detail-toggle {
    font-size: 12px;
    color: #3498db;
    cursor: pointer;
    margin-top: 3px;
    user-select: none;
    font-weight: 600;
}
.hint-detail-toggle:hover { text-decoration: underline; }
.hint-detail {
    display: none;
    font-size: 12px;
    color: #444;
    line-height: 1.5;
    margin-top: 4px;
    padding: 6px 8px;
    background: rgba(52,152,219,0.08);
    border-radius: 4px;
    white-space: pre-line;
}
.hint-detail.visible { display: block; }

/* ── Betting Area ────────────────────────────────── */
.betting-area {
    text-align: center;
    width: 100%;
}

/* ── Bet Zones ───────────────────────────────────── */
.bet-zones {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.bet-zone {
    width: 140px;
    padding: 10px 8px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0,0,0,0.15);
    text-align: center;
}
.bet-zone:hover {
    border-color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.25);
}
.bet-zone.active {
    border-color: #f1c40f;
    background: rgba(241,196,15,0.15);
    box-shadow: 0 0 12px rgba(241,196,15,0.3);
}
.bet-zone-label {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.bet-zone-payout {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}
.zone-tie .bet-zone-label {
    color: #f1c40f;
}

.chip-rack {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}
.chip {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px dashed rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.chip:hover { transform: scale(1.12); box-shadow: 0 5px 12px rgba(0,0,0,0.35); }

.bet-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    font-size: 15px;
}
.bet-amount {
    font-size: 22px;
    font-weight: 700;
    color: #f1c40f;
}
.btn-deal, .btn-clear, .btn-rebet {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.15s;
}
.btn-deal {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #2c3e50;
}
.btn-deal:hover { transform: translateY(-2px); }
.btn-deal:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-clear {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.btn-rebet {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ── Stats Bar ───────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    padding: 4px 0;
}
.stats-bar span { white-space: nowrap; }

/* ── Result Overlay ──────────────────────────────── */
.result-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
    z-index: 10;
    text-transform: uppercase;
    white-space: nowrap;
}
.result-banner.show {
    animation: resultPop 1.2s ease forwards;
}
@keyframes resultPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1); }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* ── Message area ────────────────────────────────── */
.message-area {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    min-height: 24px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
