/* Reset & Variables */
:root {
    --bg-dark: #0c0d10;
    --table-green: radial-gradient(circle, #196f3d 0%, #114c29 100%);
    --wood-border: linear-gradient(135deg, #3d1d07 0%, #1e0d02 100%);
    --text-light: #f5f6f8;
    --text-muted: #8a8d98;
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --chip-white: #ffffff;
    --chip-red: #ef4444;
    --chip-blue: #3b82f6;
    --chip-green: #10b981;
    --glow-active: 0 0 15px rgba(99, 102, 241, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

/* Screens */
.screen {
    display: none;
    height: 100vh;
    width: 100vw;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Lobby Styling */
#lobby {
    background: radial-gradient(circle at center, #1b2030 0%, #0c0d10 100%);
    display: none;
    align-items: center;
    justify-content: center;
}

#lobby.active {
    display: flex;
}

.lobby-card {
    background: rgba(20, 24, 38, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.lobby-card h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    margin-bottom: 5px;
}

.lobby-card h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.lobby-card .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    background: rgba(10, 12, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Range slider styling */
.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-color);
    transition: transform 0.1s;
}

.range-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-container span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success-color);
    min-width: 80px;
    text-align: right;
}

.form-group .hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-light);
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* GAME TABLE SCREEN */
#game-table {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
}

#game-table.active {
    display: flex;
}

.table-header {
    background: rgba(12, 13, 16, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header .header-logo {
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-light);
}

.table-header .header-info {
    display: flex;
    gap: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.table-header .header-info strong {
    color: var(--text-light);
}

/* Main Table Container */
.table-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, #1b2030 0%, #0c0d10 100%);
    position: relative;
}

/* The actual oval visual table */
.poker-table {
    width: 95%;
    max-width: 1000px;
    height: 85%;
    max-height: 560px;
    background: var(--wood-border);
    border-radius: 240px; /* Perfect oval shape */
    padding: 22px; /* Wood rail thickness */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), inset 0 2px 5px rgba(255, 255, 255, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.felt {
    width: 100%;
    height: 100%;
    background: var(--table-green);
    border-radius: 220px;
    position: relative;
    box-shadow: inset 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 1px 3px rgba(0,0,0,0.8);
    border: 3px solid #0e3b1c;
    overflow: visible; /* To allow cards / chip slide overflow */
}

/* Center elements (Pot, deck, community cards) */
.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.pot-display {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.pot-display .label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.pot-display .amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success-color);
}

.deck-container {
    position: absolute;
    left: -80px;
    top: 50%;
    transform: translateY(-50%);
}

.deck-back {
    width: 48px;
    height: 68px;
    border-radius: 4px;
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: -2px 2px 5px rgba(0,0,0,0.5);
    position: relative;
}

/* Geometric pattern on deck back similar to reference */
.deck-back::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(245, 158, 11, 0.5); /* Gold outline */
    border-radius: 2px;
    background-image: radial-gradient(rgba(245, 158, 11, 0.3) 1px, transparent 0);
    background-size: 6px 6px;
}

.community-cards {
    display: flex;
    gap: 8px;
    height: 68px;
    min-width: 272px; /* 5 cards * 48px + 4 * 8px gap */
    justify-content: center;
}

/* Card render */
.card-slot {
    width: 48px;
    height: 68px;
    border-radius: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(0,0,0,0.1);
}

.card {
    width: 48px;
    height: 68px;
    perspective: 500px;
    cursor: default;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.card-face.back {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-face.back::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 1px;
    background-image: radial-gradient(rgba(245, 158, 11, 0.2) 1px, transparent 0);
    background-size: 5px 5px;
}

.card-face.front {
    background: #ffffff;
    border: 1px solid #c8ccd6;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px 5px;
    color: #1e293b;
    font-weight: 800;
    font-size: 0.95rem;
}

.card-face.front.red-suit {
    color: var(--danger-color);
}

.card-face.front.green-suit {
    color: var(--success-color);
}

.card-face.front .card-suit {
    align-self: center;
    font-size: 1.4rem;
    line-height: 1;
    margin-top: -5px;
}

.card-face.front .card-bottom {
    transform: rotate(180deg);
    font-size: 0.65rem;
}

/* Animations for dealing */
@keyframes deal-card {
    from {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
        opacity: 0;
    }
}

/* PLAYER SPOTS */
.player-spot {
    position: absolute;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: all 0.3s;
}

/* 6 Positions around the oval table */
.spot-0 { bottom: -28px; left: 50%; transform: translateX(-50%); } /* Humain */
.spot-1 { bottom: 22px; left: 4%; }  /* Bas Gauche */
.spot-2 { top: 22px; left: 4%; }     /* Haut Gauche */
.spot-3 { top: -30px; left: 50%; transform: translateX(-50%); } /* Haut Centre */
.spot-4 { top: 22px; right: 4%; }    /* Haut Droite */
.spot-5 { bottom: 22px; right: 4%; } /* Bas Droite */

/* Player profile box - single line row layout */
.player-profile {
    background: rgba(12, 15, 24, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 100%;
    padding: 6px 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    position: relative;
    transition: all 0.3s;
}

/* Active turn indicator */
.player-spot.active .player-profile {
    border-color: var(--primary-color);
    box-shadow: var(--glow-active);
}

/* Winner spot highlight */
.player-spot.winner .player-profile {
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    animation: winner-pulse 0.8s infinite alternate;
}

@keyframes winner-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

.player-profile .name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
    text-align: left;
}

.player-spot.human .player-profile .name {
    color: var(--primary-color);
}

.player-profile .chips {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--success-color);
    white-space: nowrap;
}

/* Premium interactivity: Lift cards on hover for human player */
.player-spot.human .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.player-spot.human .card:hover {
    transform: translateY(-8px) scale(1.06);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Player cards area */
.player-cards {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    height: 68px;
    justify-content: center;
}

/* Active Bet Indicator (Chips display on table) */
.player-bet {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success-color);
    position: absolute;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Position bet markers relative to player spot */
.spot-0 .player-bet { top: -35px; }
.spot-1 .player-bet { right: -60px; top: 10px; }
.spot-2 .player-bet { right: -60px; bottom: 10px; }
.spot-3 .player-bet { bottom: -35px; }
.spot-4 .player-bet { left: -60px; bottom: 10px; }
.spot-5 .player-bet { left: -60px; top: 10px; }

/* Status tags (Folded, All-In, last action text bubble) */
.player-action-bubble {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    position: absolute;
    top: -24px;
    animation: bounce 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.player-status-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 12;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.player-status-tag.fold-tag {
    background: #475569;
    color: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.player-status-tag.allin-tag {
    background: var(--danger-color);
    color: white;
    border: 1px solid #fecaca;
    animation: pulse 1s infinite alternate;
}

/* Dealer / Blind Buttons */
.dealer-button, .blind-button {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    position: absolute;
}

.dealer-button {
    background: #ffffff;
    color: #000000;
    border: 1px solid #cccccc;
}

.blind-button.sb {
    background: #0ea5e9;
    color: white;
}

.blind-button.bb {
    background: #2563eb;
    color: white;
}

/* Position button markers relative to player spot */
.spot-0 .dealer-button, .spot-0 .blind-button { left: -15px; top: 10px; }
.spot-1 .dealer-button, .spot-1 .blind-button { right: -15px; top: -10px; }
.spot-2 .dealer-button, .spot-2 .blind-button { right: -15px; bottom: -10px; }
.spot-3 .dealer-button, .spot-3 .blind-button { right: -15px; top: 10px; }
.spot-4 .dealer-button, .spot-4 .blind-button { left: -15px; bottom: -10px; }
.spot-5 .dealer-button, .spot-5 .blind-button { left: -15px; top: -10px; }

/* Visual Chip stack render in CSS */
.chip-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

.chip-icon.val-1  { background: var(--chip-white); border: 2px dashed #000; }
.chip-icon.val-5  { background: var(--chip-red); border: 2px dashed #fff; }
.chip-icon.val-10 { background: var(--chip-blue); border: 2px dashed #fff; }
.chip-icon.val-25 { background: var(--chip-green); border: 2px dashed #fff; }

/* FOOTER CONTROL PANEL */
.controls-panel {
    background: rgba(12, 13, 16, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    height: 180px;
}

.logs-console {
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    background: rgba(8, 9, 12, 0.5);
}

.logs-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.logs-content {
    flex: 1;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logs-content div {
    line-height: 1.4;
}

.action-area {
    flex: 2;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.player-bankroll-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}

.player-bankroll-info strong {
    color: var(--text-light);
}

.player-bankroll-info #my-chips-breakdown {
    font-size: 0.75rem;
    color: var(--success-color);
}

.actions-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.actions-buttons button {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.actions-buttons button.fold {
    background: #374151;
}

.actions-buttons button.fold:hover {
    background: #4b5563;
}

.actions-buttons button.check {
    background: #0d9488;
}

.actions-buttons button.check:hover {
    background: #14b8a6;
}

.actions-buttons button.call {
    background: #2563eb;
}

.actions-buttons button.call:hover {
    background: #3b82f6;
}

.actions-buttons button.raise {
    background: #b45309;
}

.actions-buttons button.raise:hover {
    background: #d97706;
}

.actions-buttons button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* Raise slider area */
.raise-slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(20, 24, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
}

.raise-inputs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.raise-inputs input[type="number"] {
    background: rgba(10, 12, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--success-color);
    font-weight: 800;
    font-size: 1rem;
    width: 100px;
    text-align: center;
    padding: 4px;
    outline: none;
}

.btn-raise-confirm {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-raise-confirm:hover {
    background: #059669;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(20, 24, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    animation: scale-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Rebuy modal specific info */
.rebuy-info {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
}

.rebuy-info span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rebuy-info strong {
    color: var(--text-light);
}

/* Showdown Modal Details */
.showdown-details {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 5px 0;
}

.winner-row {
    background: rgba(16, 185, 129, 0.15);
    border: 1px dashed var(--success-color);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.winner-row .name {
    color: var(--text-light);
}

.winner-row .win-amount {
    color: var(--success-color);
    font-size: 1.1rem;
    font-weight: 800;
}

.player-hand-row {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-hand-row .name-hand {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.player-hand-row .name-hand .desc {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.player-hand-row .hand-cards-mini {
    display: flex;
    gap: 4px;
}

/* Mini card in showdown list */
.mini-card {
    width: 24px;
    height: 34px;
    background: white;
    border-radius: 2px;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mini-card.red-suit {
    color: var(--danger-color);
}

.mini-card.green-suit {
    color: var(--success-color);
}

/* Quit modal details */
.quit-details {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-row span {
    color: var(--text-muted);
}

.result-row strong {
    color: var(--text-light);
}

#quit-net-profit.positive {
    color: var(--success-color);
}

#quit-net-profit.negative {
    color: var(--danger-color);
}

/* ANIMATIONS */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); }
    100% { transform: translate(-50%, -50%) rotate(-10deg) scale(1.05); }
}

@keyframes scale-up {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Custom scrollbars */
.logs-content::-webkit-scrollbar,
.showdown-details::-webkit-scrollbar {
    width: 6px;
}

.logs-content::-webkit-scrollbar-thumb,
.showdown-details::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* AUTHENTICATION & DASHBOARD STYLES */

#home-screen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at center, #181d30 0%, #06080c 100%);
    position: relative;
    overflow: hidden;
}

#home-screen.active {
    display: flex;
}

/* Symboles de poker flottants animés */
.floating-suits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.suit-item {
    position: absolute;
    font-size: 5rem;
    font-weight: bold;
    opacity: 0.025;
    color: #ffffff;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    animation: float-around 25s linear infinite;
    user-select: none;
}

.suit-1 { top: 10%; left: 12%; animation-duration: 22s; }
.suit-2 { top: 60%; left: 15%; color: var(--danger-color); opacity: 0.035; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3)); animation-duration: 18s; }
.suit-3 { top: 15%; left: 80%; color: var(--danger-color); opacity: 0.035; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3)); animation-duration: 26s; }
.suit-4 { top: 75%; left: 82%; animation-duration: 32s; }
.suit-5 { top: 40%; left: 88%; animation-duration: 20s; }
.suit-6 { top: 82%; left: 8%; color: var(--danger-color); opacity: 0.035; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3)); animation-duration: 28s; }
.suit-7 { top: 35%; left: 5%; color: var(--danger-color); opacity: 0.035; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3)); animation-duration: 24s; }
.suit-8 { top: 85%; left: 45%; animation-duration: 30s; }

@keyframes float-around {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-30px) rotate(180deg) scale(1.15); }
    100% { transform: translateY(0) rotate(360deg) scale(1); }
}

.welcome-card {
    max-width: 550px !important;
    position: relative;
    z-index: 10; /* Devant les symboles flottants */
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.65), 0 0 40px rgba(99, 102, 241, 0.15) !important;
    animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Titre métallique or et platine brillant */
.welcome-card h1 {
    background: linear-gradient(90deg, #e0a96d, #d4af37, #ffffff, #e0a96d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine-title 4s linear infinite;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-shadow: 0 0 25px rgba(224, 169, 109, 0.2);
}

@keyframes shine-title {
    to { background-position: 200% center; }
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.auth-tab:hover {
    color: var(--text-light);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
    animation: scale-up 0.3s ease;
}

.auth-form.active {
    display: block;
}

.auth-form input[type="password"] {
    width: 100%;
    background: rgba(10, 12, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

.auth-form input[type="password"]:focus {
    border-color: var(--primary-color);
}

/* User Welcome / Dashboard Header */
.user-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.user-welcome strong {
    color: var(--primary-color);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
}

/* Bankroll display card */
.bankroll-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.bankroll-card .label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.bankroll-card .amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--success-color);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Stats card (chart container) */
.stats-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 30px;
    text-align: left;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stats-header span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.chart-container {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-empty-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.btn-play-now {
    font-size: 1.15rem !important;
    letter-spacing: 1px;
    font-weight: 800 !important;
    animation: pulse-button 2s infinite;
}

@keyframes pulse-button {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* SVG Chart Styles */
#stats-svg path.line {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 3.5;
    stroke-linecap: round;
}

#stats-svg path.line-negative {
    stroke: var(--danger-color);
}

#stats-svg path.area {
    fill: url(#area-grad-positive);
    opacity: 0.15;
}

#stats-svg path.area-negative {
    fill: url(#area-grad-negative);
    opacity: 0.15;
}

#stats-svg circle.dot {
    fill: var(--success-color);
    stroke: var(--bg-dark);
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.2s;
}

#stats-svg circle.dot-negative {
    fill: var(--danger-color);
}

#stats-svg circle.dot:hover {
    transform: scale(1.4);
}

#stats-svg line.grid-line {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1;
}

#stats-svg text.axis-label {
    fill: var(--text-muted);
    font-size: 7px;
    font-family: monospace;
}

/* Symboles et Jetons de poker flottants en arrière-plan */
.floating-chips {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2; /* Derrière le formulaire, devant les enseignes */
}

.bg-chip {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    opacity: 0.12;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.4);
    animation: float-chip 20s ease-in-out infinite;
    user-select: none;
}

.bg-chip::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, 0.4);
}

.bg-chip::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.chip-red {
    background: radial-gradient(circle, #ff5e62 25%, #d32f2f 90%);
}
.chip-blue {
    background: radial-gradient(circle, #4ea8de 25%, #0077b6 90%);
}
.chip-green {
    background: radial-gradient(circle, #70e000 25%, #38b000 90%);
}
.chip-black {
    background: radial-gradient(circle, #555555 25%, #111111 90%);
}

/* Positions des jetons sur les côtés */
.chip-1 { top: 8%; left: 4%; animation-duration: 24s; }
.chip-2 { top: 48%; left: 3%; animation-duration: 18s; }
.chip-3 { top: 78%; left: 8%; animation-duration: 28s; }
.chip-4 { top: 12%; left: 86%; animation-duration: 22s; }
.chip-5 { top: 52%; left: 91%; animation-duration: 32s; }
.chip-6 { top: 82%; left: 85%; animation-duration: 20s; }
.chip-7 { top: 90%; left: 24%; animation-duration: 26s; }
.chip-8 { top: 4%; left: 52%; animation-duration: 30s; }

@keyframes float-chip {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

/* Personnalisation premium du Slider Range Relance */
input[type="range"]#raise-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    margin: 15px 0;
}

input[type="range"]#raise-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    transition: transform 0.15s, background-color 0.2s;
}

input[type="range"]#raise-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #059669;
}

/* MULTIPLAYER SETUP & LOBBY SCREENS */
#multiplayer-setup,
#multiplayer-lobby {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at center, #181d30 0%, #06080c 100%);
    position: relative;
    overflow: hidden;
}

#multiplayer-setup.active,
#multiplayer-lobby.active {
    display: flex;
}

/* Waiting Room Player List */
.waiting-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.waiting-player-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.waiting-player-item .seat-num {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 10px;
}

.waiting-player-item .player-name-waiting {
    color: var(--text-light);
    flex: 1;
}

.waiting-player-item .player-status-waiting {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.waiting-player-item.empty-seat {
    border-style: dashed;
    background: transparent;
    opacity: 0.4;
}

.waiting-player-item.empty-seat .player-name-waiting {
    color: var(--text-muted);
    font-weight: 400;
}

.waiting-player-item.empty-seat .player-status-waiting {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Indicateur de tour actif (Point Rouge Pulsant) */
.active-turn-dot {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 10px;
    height: 10px;
    background-color: #ef4444; /* Rouge vif */
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    z-index: 10;
    animation: active-pulse-red 1s infinite alternate ease-in-out;
}

@keyframes active-pulse-red {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 14px #ef4444;
    }
}

/* RESPONSIVE DESIGN (Mise à l'échelle pour écrans de toutes tailles) */
@media (max-width: 1100px) {
    .player-spot {
        width: 120px;
    }
    .poker-table {
        padding: 16px;
        max-height: 480px;
    }
    .card {
        width: 42px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .player-spot {
        width: 95px;
        font-size: 0.8rem;
    }
    .poker-table {
        max-height: 420px;
        border-radius: 160px;
        padding: 10px;
    }
    .felt {
        border-radius: 150px;
    }
    .card {
        width: 32px;
        height: 48px;
    }
    .card-top, .card-bottom {
        font-size: 0.65rem;
    }
    .card-suit {
        font-size: 0.8rem;
    }
    /* Repositionnement compact des sièges (poussés vers l'extérieur) */
    .spot-1 { bottom: 12px; left: 2%; }
    .spot-2 { top: 12px; left: 2%; }
    .spot-4 { top: 12px; right: 2%; }
    .spot-5 { bottom: 12px; right: 2%; }
    .spot-0 { bottom: -25px; }
    .spot-3 { top: -28px; }
    
    .player-profile {
        padding: 4px 6px;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    .player-profile .name {
        max-width: 50px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .player-bet {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    .chip-icon {
        width: 12px;
        height: 12px;
    }
    .table-center {
        gap: 6px;
    }
    .pot-display {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    .community-cards-container {
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .player-spot {
        width: 80px;
    }
    .player-profile {
        font-size: 0.65rem;
        padding: 3px 5px;
    }
    .player-profile .name {
        max-width: 35px;
    }
    .poker-table {
        max-height: 340px;
        border-radius: 120px;
    }
    .felt {
        border-radius: 110px;
    }
    .card {
        width: 26px;
        height: 38px;
    }
    .card-top, .card-bottom {
        font-size: 0.55rem;
    }
    .card-suit {
        font-size: 0.7rem;
    }
    .active-turn-dot {
        width: 7px;
        height: 7px;
        top: 4px;
        left: 4px;
    }
}
