/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ===== SCHERMATE ===== */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* ===== AUTH SCREEN (index.html) ===== */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.logo h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 img {
    width: 65px;
    height: 65px;
    transform: translateY(-3px);
}
.logo-image {
    width: 450px;           /* Aumenta la grandezza orizzontale */
    height: 120px;          /* Diminuisce drasticamente l'altezza */
    object-fit: cover;      /* "Ritaglia" l'immagine per mostrare solo la parte centrale */
    object-position: center; /* Mantiene la scritta BLCASINO al centro del ritaglio */
    max-width: 100%;
    margin-bottom: 10px;
    border-radius: 0;
    box-shadow: none;
}

.logo p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 40px;
}

.auth-form {
    display: none;
    background: rgba(30, 41, 59, 0.8);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

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

.auth-form h2 {
    margin-bottom: 30px;
    color: #f8fafc;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input::placeholder {
    color: #64748b;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

.btn-warning {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.btn-success {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.switch-form {
    margin-top: 20px;
    color: #94a3b8;
}

.switch-form a {
    color: #3b82f6;
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* ===== GAME SCREEN (game.html) ===== */
#game-screen.active {
    padding: 10px 15px;
    min-height: calc(100vh - 20px);
}

/* Header Gioco */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    gap: 10px;
}

.user-info-section {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.back-btn {
    flex-shrink: 0;
    padding: 8px 12px !important;
    min-width: 40px;
}

.user-balance-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.username {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.balance {
    background: linear-gradient(45deg, #10b981, #059669);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-btn,
.logout-btn {
    padding: 8px 12px !important;
    font-size: 13px;
}

/* Layout Principale */
.main-game-layout {
    display: flex;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Sidebar Statistiche */
.stats-sidebar {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 20px;
}

.stats-sidebar.hidden {
    width: auto;
}

.stats-sidebar.hidden .stats-container {
    display: none;
}

.toggle-stats-btn {
    padding: 10px 15px;
    background: linear-gradient(45deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-bottom: 15px;
    width: 100%;
}

.toggle-stats-btn:hover {
    background: linear-gradient(45deg, #4f46e5, #4338ca);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.stats-container {
    width: 100%;
}

.stats-box-bj {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.stats-box-bj h4 {
    text-align: center;
    color: #f8fafc;
    font-size: 16px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.stats-row-bj {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.3);
}

.stat-item-bj {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-item-bj .stat-number {
    font-size: 36px;
    font-weight: bold;
}

.stat-item-bj.win .stat-number {
    color: #22c55e;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.7);
}

.stat-item-bj.loss .stat-number {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
}

.stat-item-bj .stat-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stats-details-bj {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.detail-label {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 500;
}

.detail-value {
    font-size: 15px;
    font-weight: 700;
}

.detail-value.won {
    color: #22c55e;
}

.detail-value.lost {
    color: #ef4444;
}

.detail-value:not(.won):not(.lost) {
    color: #fbbf24;
}

/* Area Gioco Principale */
.game-area {
    flex: 1;
    min-width: 0;
}

/* Tavolo Blackjack */
.blackjack-table.inverted {
    background: linear-gradient(135deg, #0f5c2f 0%, #1a7d3e 100%);
    border: 8px solid #8b4513;
    border-radius: 20px 20px 300px 300px;
    padding: 70px 25px 50px 25px;
    margin: 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

.dealer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 35px;
}

.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 35px;
}

.player-info {
    text-align: center;
    margin-bottom: 15px;
}

.player-info h3 {
    color: #f8fafc;
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.player-info .score {
    color: #fbbf24;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Carte */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 140px;
    align-items: center;
}

.card {
    width: 95px;
    height: 133px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    color: #000000;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    position: relative;
    animation: fadeIn 0.5s ease forwards;
}

.card:hover {
    transform: translateY(-8px);
}

.card.red {
    color: #dc2626;
}

.card-back {
    background: linear-gradient(45deg, #1e40af, #3730a3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* Controlli Gioco */
.game-controls {
    background: rgba(30, 41, 59, 0.9);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin-top: 15px;
}

.betting-area {
    display: block;
}

.betting-area h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #f8fafc;
    font-size: 1.2rem;
}

.bet-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bet-btn {
    padding: 12px 18px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    color: #000000;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    font-size: 14px;
}

.bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.3);
}

.bet-btn.selected {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
}

.custom-bet {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.custom-bet input {
    padding: 12px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    width: 200px;
    text-align: center;
    font-size: 14px;
}

/* Pulsanti di Gioco */
.playing-area.horizontal {
    display: none;
}

.playing-area.horizontal.active {
    display: flex;
    justify-content: center;
    width: 100%;
}

.game-buttons-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.game-buttons-row .btn {
    min-width: 130px;
    max-width: 130px;
}

/* Risultati */
.result-area {
    display: none;
    text-align: center;
}

.result-area.active {
    display: block;
}

.result-message {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: fadeIn 0.5s ease forwards;
}

.result-message.win {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
}

.result-message.lose {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
}

.result-message.push {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    color: white;
}

/* ===== MOBILE FULL-SCREEN ===== */
@media (max-width: 768px) {
    /* Game Screen Mobile */
    #game-screen.active {
        padding: 0;
        min-height: 100vh;
    }

    .game-header {
        padding: 8px 10px;
        margin-bottom: 8px;
        border-radius: 0;
    }

    .main-game-layout {
        flex-direction: column;
        gap: 0;
        margin: 0;
        max-width: 100%;
    }

    .stats-sidebar {
        width: 100%;
        order: 3;
        position: static;
        margin-top: 10px;
        padding: 0 10px;
    }

    .game-area {
        order: 1;
        width: 100%;
        flex: none;
    }

    /* Tavolo Full-Screen */
    .blackjack-table.inverted {
        border-radius: 0 !important;
        padding: 30px 15px 40px 15px !important;
        min-height: 55vh;
        margin: 0 !important;
        width: 100%;
        border: none;
        border-bottom: 8px solid #8b4513;
        border-top: 8px solid #8b4513;
    }

    .dealer-section {
        margin-bottom: 15px;
    }

    .player-section {
        margin-top: 15px;
    }

    .player-info h3 {
        font-size: 1.1rem;
    }

    .player-info .score {
        font-size: 0.9rem;
    }

    .card {
        width: 60px;
        height: 84px;
        font-size: 12px;
        padding: 6px;
    }

    /* Controlli Gioco Mobile */
    .game-controls {
        padding: 12px 10px !important;
        margin-top: 0 !important;
        border-radius: 0;
        order: 2;
    }

    .betting-area h4 {
        font-size: 1rem;
    }

    .bet-buttons {
        gap: 6px;
    }

    .bet-btn {
        min-width: 60px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .custom-bet {
        flex-direction: column;
        gap: 8px;
    }

    /* Pulsanti di Gioco Mobile */
    .playing-area.horizontal.active {
        padding: 10px;
    }

    .game-buttons-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .game-buttons-row .btn {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 8px !important;
        font-size: 13px !important;
    }
}

/* ===== ANIMAZIONI ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes highlight {
    0% { background: rgba(59, 130, 246, 0.2); }
    100% { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }
}

/* ===== UTILITY ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.3);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(45deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(45deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ===== SCHERMATE ===== */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 10px 15px;
}

.screen.active {
    display: block;
    min-height: calc(100vh - 20px);
}

/* ===== PANNELLO ADMIN ===== */
#admin-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    z-index: 1000;
    padding: 20px;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 15px;
    border: 2px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.admin-header h2 {
    font-size: 2rem;
    background: linear-gradient(45deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(30, 41, 59, 0.8);
    padding: 15px;
    border-radius: 12px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.tab-btn {
    padding: 12px 20px;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.tab-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.tab-btn.active {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.tab-content {
    display: none;
    width: 100%;
    min-height: 400px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.admin-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ===== STATISTICHE ADMIN ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: #3b82f6;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-card h4 {
    color: #94a3b8;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #f8fafc;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* ===== TABELLE DATI ===== */
.data-table {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.data-table th {
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ===== MULTIPLAYER STATS ===== */
.multiplayer-stats {
    padding: 20px 0;
}

.tables-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.table-stats-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.table-stats-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.table-stats-card h4 {
    margin: 0 0 15px 0;
    color: #f1f5f9;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
    font-size: 1.2rem;
    text-align: center;
}

.table-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-row:not(:last-child) {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-label {
    color: #94a3b8;
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: #f1f5f9;
    font-size: 1rem;
}

.profit-row .stat-value.positive {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.profit-row .stat-value.negative {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.table-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #334155;
    text-align: center;
}

/* ===== BOTTONI ===== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

.btn-warning {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

/* ===== NOTIFICHE E LOADING ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(45deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(45deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.3);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== ANIMAZIONI ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #admin-screen {
        padding: 15px 10px;
    }
    
    .admin-header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-header h2 {
        font-size: 1.5rem;
    }
    
    .admin-tabs {
        padding: 10px;
        gap: 6px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-width: 100px;
        flex: 1;
    }
    
    .admin-content {
        padding: 15px;
        max-height: calc(100vh - 250px);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .data-table {
        overflow-x: auto;
    }
    
    .data-table table {
        min-width: 600px;
    }
    
    .tables-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-stats-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    #admin-screen {
        padding: 10px 8px;
    }
    
    .admin-header {
        padding: 12px;
    }
    
    .admin-header h2 {
        font-size: 1.3rem;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        min-width: auto;
    }
    
    .admin-content {
        padding: 10px;
        max-height: calc(100vh - 280px);
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* ===== SCROLLBAR PERSONALIZZATA ===== */
.admin-content::-webkit-scrollbar {
    width: 8px;
}

.admin-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #1d4ed8, #1e40af);
}

/* ===== ACCESSIBILITÀ ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus,
input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== DIMENSIONI TAVOLO RIDOTTE ===== */
.blackjack-table.inverted {
    background: linear-gradient(135deg, #0f5c2f 0%, #1a7d3e 100%);
    border: 8px solid #8b4513;
    border-radius: 20px 20px 280px 280px; /* Ridotto da 300px */
    padding: 60px 25px 40px 25px; /* Ridotto padding verticale */
    margin: 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-height: 380px; /* Ridotto da 450px */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

/* Sezioni dealer e player più compatte */
.dealer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px; /* Ridotto da 35px */
}

.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 25px; /* Ridotto da 35px */
}

/* ===== STATISTICHE GENERALI - NUMERI PIÙ GRANDI ===== */
.stats-box-bj h4 {
    text-align: center;
    color: #f8fafc;
    font-size: 17px; /* Aumentato da 16px */
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.stat-item-bj .stat-number {
    font-size: 42px; /* Aumentato da 36px */
    font-weight: bold;
}

.stat-item-bj .stat-label {
    font-size: 12px; /* Aumentato da 11px */
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stats-details-bj {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Aumentato da 10px */
}

.detail-label {
    font-size: 13px; /* Aumentato da 12px */
    color: #cbd5e1;
    font-weight: 500;
}

.detail-value {
    font-size: 16px; /* Aumentato da 15px */
    font-weight: 700;
}

/* ===== STATISTICHE TAVOLI MULTIPLAYER - NUMERI PIÙ GRANDI ===== */
.table-stats-card h4 {
    margin: 0 0 18px 0; /* Aumentato margine */
    color: #f1f5f9;
    border-bottom: 1px solid #334155;
    padding-bottom: 12px; /* Aumentato padding */
    font-size: 1.3rem; /* Aumentato da 1.2rem */
    text-align: center;
}

.table-stats {
    display: flex;
    flex-direction: column;
    gap: 14px; /* Aumentato da 12px */
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0; /* Aumentato da 8px */
}

.stat-label {
    color: #94a3b8;
    font-weight: 500;
    font-size: 14px; /* Aumentato */
}

.stat-value {
    font-weight: bold;
    color: #f1f5f9;
    font-size: 1.1rem; /* Aumentato da 1rem */
}

/* ===== STATISTICHE ADMIN - NUMERI PIÙ GRANDI ===== */
.stat-card h4 {
    color: #94a3b8;
    margin-bottom: 18px; /* Aumentato da 15px */
    font-size: 15px; /* Aumentato da 14px */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.4rem; /* Aumentato da 2.2rem */
    font-weight: bold;
    color: #f8fafc;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* ===== CARTE LEGGERMENTE PIÙ COMPATTE ===== */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 10px; /* Ridotto da 12px */
    flex-wrap: wrap;
    min-height: 130px; /* Ridotto da 140px */
    align-items: center;
}

.card {
    width: 90px; /* Ridotto da 95px */
    height: 126px; /* Ridotto da 133px */
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px; /* Ridotto da 10px */
    color: #000000;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    position: relative;
    animation: fadeIn 0.5s ease forwards;
}

/* ===== CONTROLLI GIOCO PIÙ COMPATTI ===== */
.game-controls {
    background: rgba(30, 41, 59, 0.9);
    padding: 12px 15px; /* Ridotto padding verticale */
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin-top: 12px; /* Ridotto da 15px */
}

.betting-area h4 {
    text-align: center;
    margin-bottom: 18px; /* Ridotto da 20px */
    color: #f8fafc;
    font-size: 1.2rem;
}

/* ===== ADATTAMENTO MOBILE PER NUOVE DIMENSIONI ===== */
@media (max-width: 768px) {
    /* Tavolo mobile più compatto */
    .blackjack-table.inverted {
        border-radius: 15px 15px 180px 180px; /* Ridotto */
        padding: 40px 15px 30px 15px !important; /* Più compatto */
        min-height: 320px; /* Ridotto da 55vh */
        margin: 0 !important;
        width: 100%;
        border: none;
        border-bottom: 8px solid #8b4513;
        border-top: 8px solid #8b4513;
    }
    
    .dealer-section {
        margin-bottom: 20px; /* Ridotto */
    }
    
    .player-section {
        margin-top: 20px; /* Ridotto */
    }
    
    /* Carte mobile più compatte */
    .card {
        width: 65px; /* Ridotto da 75px */
        height: 91px; /* Ridotto da 105px */
        font-size: 14px;
        padding: 6px;
    }
    
    /* Statistiche mobile - manteniamo numeri grandi */
    .stat-item-bj .stat-number {
        font-size: 38px; /* Ridotto ma comunque grande */
    }
    
    .stats-box-bj h4 {
        font-size: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 2rem; /* Leggermente ridotto per mobile */
    }
}

@media (max-width: 480px) {
    /* Tavolo mobile molto compatto */
    .blackjack-table.inverted {
        border-radius: 12px 12px 150px 150px;
        padding: 35px 12px 25px 12px !important;
        min-height: 280px;
        border: 5px solid #8b4513;
    }
    
    /* Carte mobile ultra compatte */
    .card {
        width: 60px;
        height: 84px;
        font-size: 12px;
        padding: 5px;
    }
    
    /* Statistiche mobile compatte ma leggibili */
    .stat-item-bj .stat-number {
        font-size: 34px;
    }
    
    .stats-box-bj {
        padding: 18px; /* Ridotto padding */
    }
}

/* ===== MANTIENI TUTTO IL RESTO DEL CSS ESISTENTE ===== */
/* ... resto del CSS precedente ... */

/* ===== CORREZIONI PER ALLINEAMENTO ===== */
.player-info h3 {
    color: #f8fafc;
    margin-bottom: 6px; /* Ridotto per compensare */
    font-size: 1.3rem; /* Leggermente ridotto */
}

.player-info .score {
    color: #fbbf24;
    font-weight: 600;
    font-size: 1.1rem; /* Leggermente ridotto */
}

/* ===== MIGLIORAMENTO SPAZIATURE COMPLESSIVA ===== */
.main-game-layout {
    display: flex;
    gap: 12px; /* Ridotto da 15px */
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

.stats-sidebar {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 15px; /* Ridotto da 20px */
}

/* ===== OTTIMIZZAZIONE PULSANTI ===== */
.game-buttons-row {
    display: flex;
    justify-content: center;
    gap: 10px; /* Ridotto da 12px */
    width: 100%;
}

.game-buttons-row .btn {
    min-width: 125px; /* Leggermente ridotto */
    max-width: 125px;
    padding: 11px 15px; /* Leggermente ridotto */
}

/* ===== TABELLE MULTIPLAYER PIÙ COMPATTE ===== */
.tables-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px; /* Ridotto da 20px */
    margin-top: 18px;
}

.table-stats-card {
    padding: 18px; /* Ridotto da 20px */
}