/* ===== BACCARAT MAIN STYLES ===== */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a2f1a 0%, #1a472a 100%);
    color: #ffffff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a2f1a 0%, #1a472a 100%);
    transition: opacity 0.5s;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-content {
    text-align: center;
    padding: 2rem;
}

.game-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

.game-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.welcome-info {
    margin: 2rem 0;
}

.info-item {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.info-label {
    opacity: 0.8;
    margin-right: 0.5rem;
}

.info-value {
    color: #ffd700;
    font-weight: bold;
}

.start-button {
    padding: 1.5rem 4rem;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #0a2f1a;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    font-weight: bold;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

/* ===== GAME SCREEN ===== */
.game-screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.game-screen.active {
    display: flex;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #ffd700;
}

.chips-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.chips-icon {
    font-size: 2rem;
}

.chips-value {
    font-weight: bold;
    color: #ffd700;
}

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

.round-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.round-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Table Container */
.table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
    background: linear-gradient(135deg, #1a472a 0%, #2d6a3f 100%);
    position: relative;
    overflow-y: auto;
    min-height: 0;
}

.table-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 90%;
    border: 2px solid rgba(255, 215, 0, 0.15);
    border-radius: 15px;
    pointer-events: none;
}

/* Hand Areas */
.hand-area {
    text-align: center;
    flex-shrink: 0;
}

.area-label {
    font-size: 1rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.hand-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    min-height: 2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    min-height: 80px;
    align-items: center;
}

/* Center Area */
.center-area {
    text-align: center;
    padding: 0.5rem;
    flex-shrink: 0;
}

.game-message {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.game-message.result-message {
    font-size: 1.5rem;
    animation: pulse 0.5s ease-in-out;
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

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

.score-label {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.score-value {
    font-size: 1rem;
    font-weight: bold;
    color: #ffd700;
}

/* Betting Area */
.betting-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-top: 2px solid #ffd700;
    flex-shrink: 0;
}

.betting-spots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bet-spot {
    width: 120px;
    height: 80px;
    border: 2px solid #ffd700;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.bet-spot:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.bet-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 0.1rem;
}

.bet-payout {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.bet-amount {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
}

.chip-stack {
    position: absolute;
    bottom: 5px;
    display: flex;
    gap: 1px;
    flex-wrap: wrap;
    max-width: 60px;
}

.chip-visual {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.bet-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.chip-selector {
    display: flex;
    gap: 0.5rem;
}

.chip-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.chip-btn[data-value="1"] { background: #ffffff; color: #000; }
.chip-btn[data-value="5"] { background: #e74c3c; color: #fff; }
.chip-btn[data-value="25"] { background: #2ecc71; color: #fff; }
.chip-btn[data-value="100"] { background: #2c3e50; color: #fff; }
.chip-btn[data-value="500"] { background: #9b59b6; color: #fff; }

.chip-btn:hover {
    transform: scale(1.1);
}

.chip-btn.selected {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.bet-buttons {
    display: flex;
    gap: 0.5rem;
}

.bet-action-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.deal-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #0a2f1a;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
}

.deal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.5);
}

.deal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    width: 50px;
    height: 75px;
    perspective: 1000px;
    opacity: 0;
    transform: translateX(-100px);
}

.card.dealt {
    animation: slideIn 0.4s forwards;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.face-down .card-inner {
    transform: rotateY(180deg);
}

.card.squeezing .card-inner {
    animation: squeeze 0.4s;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.card-front {
    background: white;
    border: 2px solid #333;
}

.card-back {
    background: linear-gradient(45deg, #8b0000, #dc143c);
    transform: rotateY(180deg);
}

.card-rank {
    font-size: 1.2rem;
    font-weight: bold;
}

.card-suit {
    font-size: 1.5rem;
}

/* Modals */
.game-over-modal, .exit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-modal.active, .exit-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a472a, #2d6a3f);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 3px solid #ffd700;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 1rem;
}

.modal-message {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #0a2f1a;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
