/* 
   Blackjack Counter Pro - Casino Royale Trainer Stylesheet
   Stile premium per il simulatore di blackjack
*/

/* === BASE STYLES === */
.simulator-page {
    background-color: var(--dashboard-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === SIMULATOR LAYOUT === */
.simulator-container {
    padding: 1.5rem;
}

.simulator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.simulator-header h1 {
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.simulator-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.simulator-wrapper {
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
}

/* === CONTROLS PANEL === */
.simulator-controls {
    width: 350px;
    flex-shrink: 0;
}

.control-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.panel-section {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.panel-section:hover {
    background: rgba(0, 0, 0, 0.05);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}

.panel-section h3 i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.2rem;
    width: 100%;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.range-with-value {
    display: flex;
    align-items: center;
}

.slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.range-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--accent-color);
    padding-left: 1rem;
}

.select-styled {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='6'><path d='M0 0l6 6 6-6z' fill='%23d4af37'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.select-styled:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.btn-help {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-help:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-help i {
    margin-right: 0.5rem;
}




/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
    background: var(--gradient-gold);
    color: var(--dashboard-bg);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary i {
    margin-right: 0.5rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary i {
    margin-right: 0.5rem;
}

.btn-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-info i {
    margin-right: 0.5rem;
}

/* === GAME AREA === */
.game-area-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 70px;
    left: 1rem;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-gold);
    color: var(--dashboard-bg);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--box-shadow-sm);
    transition: all 0.3s ease;
}

.game-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%23053225"/><path d="M0,25 L100,25 M0,50 L100,50 M0,75 L100,75 M25,0 L25,100 M50,0 L50,100 M75,0 L75,100" stroke="%23064024" stroke-width="0.5"/></svg>');
    background-color: #053225;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.game-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.dealer-area, .players-area-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.dealer-area h3 {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    color: var(--accent-color);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

#game-message-area {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-width: 2px;
}

.players-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.player-hand-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stile per il giocatore attivo durante il suo turno (in blu) - è il turno di chiedere carta */
.player-hand-area.active {
    border: 2px solid #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    background-color: rgba(52, 152, 219, 0.1);
    position: relative;
    z-index: 1;
    transform: translateY(-3px); /* Leggero sollevamento per evidenziare */
}

.player-hand-area.active::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    margin-left: -8px;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.9);
}

.player-name {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cards {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    overflow-x: visible;
    padding-top: 10px; /* Spazio per l'effetto hover */
    padding-bottom: 10px;
    position: relative; /* Per il posizionamento corretto degli elementi in z-index */
}

.card {
    width: 70px;
    height: 105px;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
    position: relative;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transition: none !important;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    flex-shrink: 0;
    z-index: 1; /* Livello base per carte normali */
}

/* L'ultima carta deve essere sempre completamente visibile */
.dealer-area .card:last-child,
.player-hand-area .card:last-child {
    z-index: 2; /* Un livello sopra le altre carte */
}

/* Classe dedicata per l'animazione solo delle nuove carte */
.card.new-card {
    animation: none !important;
}

.card .rank {
    font-size: 1.3rem;
    font-weight: bold;
    position: relative;
    left: -2px;
    top: -2px;
    text-shadow: 0 0 2px white;
}

.card .suit {
    font-size: 1.5rem;
    align-self: flex-end;
}

.card.hidden {
    background: linear-gradient(135deg, #d4af37, #f0e6c2);
    color: transparent;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><path d="M0 20 L40 20 M20 0 L20 40" stroke="%23b59530" stroke-width="0.5"/></svg>'),
                      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="120" viewBox="0 0 80 120"><path d="M10,10 L70,10 L70,110 L10,110 Z" stroke="%23d4af37" stroke-width="3" fill="none" rx="5" ry="5"/></svg>');
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.7);
}

.suit-♥, .suit-♦ {
    color: #d63031;
}

.suit-♣, .suit-♠ {
    color: #2d3436;
}

.hand-value {
    font-size: 0.9rem;
    color: var(--accent-light);
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.result-message {
    margin-top: 0.75rem;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.result-message.win {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.result-message.lose {
    background: rgba(220, 53, 69, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.result-message.push {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Status Bar */
.status-bar {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    white-space: nowrap;
}

.status-item i {
    color: var(--accent-color);
    opacity: 0.8;
}

.status-item span {
    font-weight: 600;
    color: var(--accent-light);
}

.penetration-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

#deck-penetration-bar-container {
    flex: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

#deck-penetration-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-gold);
    border-radius: 5px;
    transition: width 0.5s ease;
    font-size: 0;
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--box-shadow);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    font-family: var(--font-heading);
}

.modal-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-color);
}

/* RC Quiz Modal */
.quiz-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#rc-quiz-input {
    padding: 1.2rem;
    width: 150px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin: 1rem auto;
}

#rc-quiz-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3), inset 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

#rc-quiz-timer {
    font-weight: bold;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#rc-quiz-timer.warning {
    color: var(--warning-color);
}

#rc-quiz-timer.danger {
    color: var(--error-color);
}

.quiz-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.feedback-message {
    text-align: center;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    min-height: 3.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
    opacity: 0;
}

.feedback-message:not(:empty) {
    opacity: 1;
}

.enhanced-feedback {
    animation: feedback-pulse 2.5s infinite !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    border-width: 2px !important;
    transform: scale(1.02) !important;
    font-size: 1.2rem !important;
    padding: 1.8rem 1.5rem !important;
    margin: 1.5rem 0 !important;
}

.feedback-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.feedback-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.feedback-message.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.feedback-message strong {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.7rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Stats Modal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(212, 175, 55, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: var(--accent-color);
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-info .stat-total {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.feedback-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: feedback-panel-glow 2s infinite;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    border-width: 2px;
}

@keyframes feedback-panel-glow {
    0% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(212, 175, 55, 0.5); }
    100% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2); }
}

/* Count Help Modal */
.count-values-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#count-values-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.8;
}

.count-values-visual {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.value-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.value-group h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.value-group.positive h4 {
    color: var(--success-color);
}

.value-group.neutral h4 {
    color: var(--text-primary);
}

.value-group.negative h4 {
    color: var(--error-color);
}

.card-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mini-card {
    width: 40px;
    height: 60px;
    background: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #2d3436;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tutorial Modal */
.tutorial-content {
    text-align: center;
}

.tutorial-steps {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.tutorial-step:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--dashboard-bg);
    flex-shrink: 0;
}

.step-info h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.step-info p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.tutorial-footer {
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 1rem;
}

/* === RESPONSIVE STYLES === */
@media (max-width: 1100px) {
    .simulator-wrapper {
        flex-direction: column;
    }
    
    .simulator-controls {
        width: 100%;
    }
    
    .game-area-wrapper {
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .simulator-container {
        padding: 1rem;
    }
    
    .simulator-header h1 {
        font-size: 1.8rem;
    }
    
    .simulator-header p {
        font-size: 0.9rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        top: 80px;
        z-index: 1001;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .simulator-controls {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 300px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        overflow-y: auto;
        background: var(--dashboard-bg);
        padding: 1rem;
        box-shadow: none;
    }
    
    .simulator-controls.open {
        transform: translateX(0);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }
    
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(3px);
    }
    
    body.menu-open::after {
        opacity: 1;
        visibility: visible;
    }
    
    .status-bar {
        justify-content: center;
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .status-item {
        flex-basis: calc(50% - 0.5rem);
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        justify-content: center;
    }
    
    .penetration-container {
        flex-basis: 100%;
        margin-top: 0.25rem;
    }
    
    .card {
        width: 50px;
        height: 75px;
    }
    
    .card .rank {
        font-size: 0.8rem;
        font-weight: bold;
        background-color: rgba(255, 255, 255, 0.7);
        padding: 1px 2px;
        border-radius: 2px;
        position: relative;
        z-index: 5;
    }
    
    .card .suit {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        width: 95%;
        max-width: 500px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .quiz-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .quiz-buttons button {
        width: 100%;
        padding: 0.8rem;
    }
    
    .control-panel {
        border-radius: 0;
        box-shadow: none;
    }
    
    .panel-section {
        padding: 1.25rem;
    }
    
    .panel-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        gap: 0.75rem;
    }
    
    .btn-primary, .btn-secondary, .btn-info {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    /* Giocatori ben distinti */
    .players-area {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
        gap: 8px;
        width: 100%;
    }
    
    .player-hand-area {
        padding: 8px 5px 5px;
        min-width: unset;
        overflow: hidden; /* Mantiene l'effetto ventaglio nel contenitore */
        border-radius: var(--border-radius);
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
        position: relative;
    }
    
    /* Stile delle carte per l'effetto ventaglio con visibilità migliore - posizionamento immediato */
    .player-hand-area .card {
        width: 33px;
        height: 50px;
        margin-left: -6px; /* Sovrapposizione molto ridotta */
        flex-shrink: 0;
        transform-origin: bottom center;
        border-radius: 3px;
        position: absolute; /* Posizionamento assoluto per il vero ventaglio */
        left: 50%; /* Centro del contenitore */
        bottom: 0; /* Allineamento in basso */
        transition: none !important; /* Disabilita qualsiasi transizione */
        animation: none !important; /* Disabilita qualsiasi animazione */
    }
    
    /* Posizionamento specifico per ogni carta nel ventaglio */
    .player-hand-area .card:first-child {
        transform: rotate(-15deg) translateX(-25px); /* Prima carta ruotata a sinistra */
        z-index: 1;
    }
    
    .player-hand-area .card:nth-child(2) {
        transform: rotate(-8deg) translateX(-15px);
        z-index: 2;
    }
    
    .player-hand-area .card:nth-child(3) {
        transform: rotate(0deg) translateX(-5px); /* Carta centrale */
        z-index: 3;
    }
    
    .player-hand-area .card:nth-child(4) {
        transform: rotate(8deg) translateX(5px);
        z-index: 4;
    }
    
    .player-hand-area .card:nth-child(5) {
        transform: rotate(15deg) translateX(15px);
        z-index: 5;
    }
    
    .player-hand-area .card:nth-child(6) {
        transform: rotate(22deg) translateX(25px);
        z-index: 6;
    }
    
    .player-hand-area .card:nth-child(7) {
        transform: rotate(30deg) translateX(35px);
        z-index: 7;
    }
    
    /* Migliora leggibilità dei valori delle carte */
    .player-hand-area .card .rank {
        font-size: 0.85rem;
        font-weight: bold;
        background-color: rgba(255, 255, 255, 0.9);
        padding: 1px 2px;
        border-radius: 2px;
        position: absolute;
        top: 1px;
        left: 1px;
        z-index: 2;
    }
    
    .player-hand-area .card .suit {
        font-size: 0.9rem;
        position: absolute;
        bottom: 1px;
        right: 1px;
    }
    
    /* Stesso effetto per il dealer */
    .dealer-area {
        overflow: hidden;
        padding: 8px 5px 5px;
        border-radius: var(--border-radius);
        position: relative;
        min-height: 80px; /* Altezza minima per garantire visibilità */
        background: rgba(0, 0, 0, 0.2); /* Sfondo leggero per distinguere l'area */
        border: 1px solid rgba(255, 255, 255, 0.1); /* Bordo sottile per definire l'area */
    }
    
    .dealer-area .cards {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        min-height: 120px;
        position: relative;
    }
    
    .dealer-area .card {
        width: 28px;
        height: 42px;
        margin-right: 3px;
        position: relative;
        transform: none !important;
        border: 1px solid rgba(255, 255, 255, 0.3); /* Bordo più visibile */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); /* Ombra più evidente */
    }
    
    .dealer-area .card:first-child,
    .dealer-area .card:nth-child(2),
    .dealer-area .card:nth-child(3),
    .dealer-area .card:nth-child(4),
    .dealer-area .card:nth-child(5),
    .dealer-area .card:nth-child(6),
    .dealer-area .card:nth-child(7) {
        transform: none !important;
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
    }
    
    .dealer-area .card .rank {
        font-size: 0.85rem;
        font-weight: bold;
        background-color: rgba(255, 255, 255, 0.9);
        padding: 1px 2px;
        border-radius: 2px;
        position: absolute;
        top: 1px;
        left: 1px;
        z-index: 2;
    }
    
    .dealer-area .card .suit {
        font-size: 0.9rem;
        position: absolute;
        bottom: 1px;
        right: 1px;
    }
    
    /* Risultato sotto le carte */
    .result-message {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        margin-top: 0.2rem;
        clear: both;
        position: relative;
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .simulator-header h1 {
        font-size: 1.5rem;
    }
    
    .simulator-header p {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .game-table {
        padding: 0.5rem;
    }
    
    /* Adattamenti per schermi più piccoli */
    .players-area {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 6px;
    }
    
    .player-hand-area {
        padding: 6px 3px 3px;
    }
    
    /* Ventaglio più compatto su schermi piccoli */
    .player-hand-area .card,
    .dealer-area .card {
        width: 28px;
        height: 42px;
    }
    
    /* Posizionamento specifico per ogni carta su schermi piccoli */
    .player-hand-area .card:first-child,
    .dealer-area .card:first-child {
        transform: rotate(-15deg) translateX(-20px);
    }
    
    .player-hand-area .card:nth-child(2),
    .dealer-area .card:nth-child(2) {
        transform: rotate(-8deg) translateX(-12px);
    }
    
    .player-hand-area .card:nth-child(3),
    .dealer-area .card:nth-child(3) {
        transform: rotate(0deg) translateX(-4px);
    }
    
    .player-hand-area .card:nth-child(4),
    .dealer-area .card:nth-child(4) {
        transform: rotate(8deg) translateX(4px);
    }
    
    .player-hand-area .card:nth-child(5),
    .dealer-area .card:nth-child(5) {
        transform: rotate(15deg) translateX(12px);
    }
    
    .player-hand-area .card:nth-child(6),
    .dealer-area .card:nth-child(6) {
        transform: rotate(22deg) translateX(20px);
    }
    
    .player-hand-area .card:nth-child(7),
    .dealer-area .card:nth-child(7) {
        transform: rotate(30deg) translateX(28px);
    }
    
    .player-hand-area .result-message {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .dealer-area .card {
        width: 35px;
        height: 52px;
        margin-right: 3px;
        position: relative;
        transform: none !important;
    }
    
    .dealer-area .cards {
        padding: 5px;
        min-height: 65px;
    }
}

@media (max-width: 360px), (max-height: 600px) {
    .players-area {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 4px;
    }
    
    .player-hand-area {
        padding: 6px 3px 3px;
    }
    
    .player-hand-area .card,
    .dealer-area .card {
        width: 24px;
        height: 36px;
    }
    
    .player-hand-area .card:first-child,
    .dealer-area .card:first-child {
        transform: rotate(-12deg) translateX(-16px);
    }
    
    .player-hand-area .card:nth-child(2),
    .dealer-area .card:nth-child(2) {
        transform: rotate(-6deg) translateX(-8px);
    }
    
    .player-hand-area .card:nth-child(3),
    .dealer-area .card:nth-child(3) {
        transform: rotate(0deg) translateX(0px);
    }
    
    .player-hand-area .card:nth-child(4),
    .dealer-area .card:nth-child(4) {
        transform: rotate(6deg) translateX(8px);
    }
    
    .player-hand-area .card:nth-child(5),
    .dealer-area .card:nth-child(5) {
        transform: rotate(12deg) translateX(16px);
    }
    
    .player-hand-area .card:nth-child(6),
    .dealer-area .card:nth-child(6) {
        transform: rotate(18deg) translateX(22px);
    }
    
    .player-hand-area .card:nth-child(7),
    .dealer-area .card:nth-child(7) {
        transform: rotate(24deg) translateX(28px);
    }
    
    .dealer-area h3 {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    #game-message-area {
        min-height: 1.5rem;
        padding: 0.3rem;
        font-size: 0.75rem;
    }
    
    .player-hand-area .result-message {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .dealer-area .card {
        width: 28px;
        height: 42px;
        margin-right: 2px;
    }
}

/* Nessuno scrolling orizzontale nell'area giocatori */

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 2px var(--accent-color), 0 0 15px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 0 4px var(--accent-color), 0 0 25px rgba(212, 175, 55, 0.7); }
    100% { box-shadow: 0 0 0 2px var(--accent-color), 0 0 15px rgba(212, 175, 55, 0.3); }
}

.fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.slideIn {
    animation: slideIn 0.5s ease forwards;
}

/* Stile per l'evidenziazione durante la distribuzione delle carte (in giallo/oro) */
.pulse-highlight {
    animation: pulseHighlight 1.5s ease infinite;
    z-index: 2;
    border: 3px solid gold !important;
    box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.7) !important;
    position: relative;
}

/* Assicura che l'evidenziazione della distribuzione abbia priorità sul turno attivo */
.player-hand-area.pulse-highlight.active {
    border: 3px solid gold !important;
    box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.7) !important;
}

.player-hand-area.pulse-highlight::before,
.dealer-area.pulse-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 215, 0, 0.2);
    z-index: -1;
    border-radius: inherit;
}

/* Fix for the counting system container */
.counting-system-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.counting-system-container .select-styled {
    z-index: 10;
    position: relative;
}

/* Touch Optimizations */
@media (pointer: coarse) {
    /* Bottoni più grandi per il touch */
    .btn-primary, .btn-secondary, .btn-info {
        min-height: 44px; /* Dimensione minima raccomandata per aree touch */
    }
    
    /* Aumenta dimensione minima per elementi interattivi */
    .select-styled, 
    input[type="checkbox"],
    .toggle-switch,
    .modal-close,
    .value-btn,
    .btn-help {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Aumenta lo spazio tra elementi interattivi */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    /* Miglioramenti per il feedback tattile */
    .btn-primary:active, 
    .btn-secondary:active, 
    .btn-info:active,
    .modal-close:active {
        transform: scale(0.97);
    }
    
    /* Ottimizzazioni per le carte */
    .card {
        touch-action: manipulation; /* Evita zoom su doppio tap */
    }
    
    /* Miglioramenti per slider su touch */
    .slider {
        height: 10px; /* Slider più grande su touch */
    }
    
    .slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    /* Spazi più ampi nei menu a discesa */
    .select-styled option {
        padding: 10px;
        font-size: 16px; /* Safari iOS ha dimensione del carattere minima di 16px */
    }
    
    /* Miglioramenti per i modali su dispositivi touch */
    .quiz-input-container input {
        font-size: 20px; /* Aumenta la dimensione del testo per input più grandi */
        padding: 12px;
    }
}

/* Nuovo stile per i gruppi di opzioni a pulsante */
.option-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.option-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-item label {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.btn-option-group {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-option-group.compact {
    height: 32px;
}

.btn-option {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-option.active {
    background: var(--accent-color);
    color: var(--dashboard-bg);
    font-weight: bold;
    border: 1px solid var(--accent-color);
}

.btn-option-group.compact .btn-option {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-option:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes pulse-effect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-option.pulse-effect {
    animation: pulse-effect 0.5s ease;
}

.btn-option i {
    font-size: 0.8rem;
    opacity: 1 !important;
    display: inline-block !important;
}

.btn-option.active i,
.btn-option:not(.active) i {
    opacity: 1 !important;
    display: inline-block !important;
}

.btn-option-group.compact .btn-option i {
    font-size: 0.7rem;
    opacity: 1 !important;
    display: inline-block !important;
}

/* Responsive per i pulsanti di opzione */
@media (max-width: 480px) {
    .option-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-option {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .btn-option-group.compact .btn-option {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Desktop adattativo senza scrolling */
@media (min-width: 769px) {
    .game-table {
        min-height: 500px;
        height: auto;
        max-height: calc(100vh - 250px); /* Limita altezza massima per evitare scrolling */
    }
    
    .players-area-container {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        overflow: visible;
    }
    
    .players-area {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
    
    /* Carte sempre orizzontali */
    .player-hand-area .cards {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: visible;
        min-height: 115px; /* Altezza fissa per evitare fluttuazioni di layout */
    }
    
    /* Riduce le dimensioni delle carte man mano che ne vengono aggiunte */
    .player-hand-area .cards.many-cards .card {
        transform: scale(0.9);
        margin-right: -10px; /* Overlap delle carte */
    }
    
    .player-hand-area .cards.extreme-cards .card {
        transform: scale(0.8);
        margin-right: -15px; /* Più overlap */
    }
    
    .player-hand-area {
        width: 100%;
        min-width: 0;
        padding: 0.8rem;
    }
    
    /* Carte ridimensionate per monitor grandi con molti giocatori */
    .many-players .card {
        width: 60px;
        height: 90px;
    }
}

/* Dimensioni delle carte adattative per tablet */
@media (min-width: 769px) and (max-width: 1200px) {
    .player-hand-area {
        padding: 0.8rem;
    }
    
    .players-area {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .card {
        width: 55px;
        height: 83px;
        padding: 0.4rem;
    }
    
    .card .rank {
        font-size: 1.1rem;
    }
    
    .card .suit {
        font-size: 1.3rem;
    }
    
    /* Previeni overflow nelle aree dei giocatori */
    .players-area-container {
        overflow: visible;
    }
    
    .players-area {
        overflow: visible;
    }
    
    .player-hand-area .cards {
        flex-wrap: nowrap;
        overflow-x: visible;
    }
    
    .game-table {
        min-height: 450px;
    }
}

/* Dimensiona le carte in base al numero di giocatori */
.player-hand-area {
    width: 100%;
    min-width: 0;
    padding: 0.8rem;
}

/* Carte ridimensionate in base al numero di giocatori */
.many-players .player-hand-area .card {
    width: 60px;
    height: 90px;
}

.extreme-many-players .player-hand-area .card {
    width: 50px;
    height: 75px;
}

.single-player .players-area {
    display: flex;
    justify-content: center;
}

.single-player .player-hand-area,
.few-players .player-hand-area {
    max-width: 250px;
}

.single-player .card,
.few-players .card {
    width: 70px;
    height: 105px;
}

/* Effetto hover per evidenziare carte su desktop */
@media (min-width: 769px) {
    .card:hover {
        transform: none !important;
        transition: none !important;
    }
    
    .many-cards .card:hover,
    .extreme-cards .card:hover {
        transform: none !important;
    }
}

/* Effetto touch per visualizzare meglio le carte su mobile */
@media (max-width: 768px) {
    .card:active {
        transform: none !important;
        transition: none !important;
    }
    
    .many-cards .card:active,
    .extreme-cards .card:active {
        transform: none !important;
    }
}

/* Disabilita tutte le altre animazioni globali che potrebbero influenzare le carte */
.fadeIn, 
.slideIn, 
.pulse-highlight {
    animation: none !important;
    transition: none !important;
}

/* Modifica l'animazione cardDeal per renderla istantanea */
@keyframes cardDeal {
    0%, 100% { opacity: 1; }
}

/* Disabilita tutte le altre animazioni globali che potrebbero influenzare le carte */
.card.new-card {
    animation: none !important;
}

.fadeIn, 
.slideIn, 
.pulse-highlight {
    animation: none !important;
}

/* Prominent Count Display - Redesigned */
#prominent-count-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem auto;
    position: relative;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#prominent-count-container:hover {
    transform: scale(1.05);
}

#prominent-count-display {
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.3) 0%, rgba(0, 0, 0, 0.7) 70%);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3);
    border: 3px solid rgba(212, 175, 55, 0.7);
    border-radius: 50%;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3);
    position: relative;
    animation: floating 6s infinite ease-in-out;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    padding: 0 10px;
}

#prominent-count-display:before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    opacity: 0.5;
    animation: rotate 12s linear infinite;
    pointer-events: none;
}

#prominent-count-display:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

#prominent-count-display.hidden-count {
    transform: scale(0.85);
    opacity: 0.6;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 70%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

#prominent-count-display.hidden-count #prominent-count-value,
#prominent-count-display.hidden-count .count-label {
    opacity: 0.5;
    color: #999;
}

#prominent-count-value {
    font-size: 3.6rem;
    font-weight: 700;
    color: #f0d060;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.7);
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.count-label {
    font-size: 0.9rem;
    color: #f0d060;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    z-index: 5;
}

/* Toggle icon - riposizionato sopra */
.toggle-count-visibility {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: #f0d060;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 20;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-count-visibility i {
    font-size: 0.9rem;
}

.toggle-count-visibility::after {
    content: 'Click';
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #f0d060;
}

#prominent-count-display.hidden-count .toggle-count-visibility::after {
    content: 'Click';
}

#prominent-count-display:hover .toggle-count-visibility {
    transform: translateX(-50%) scale(1.05);
}

@keyframes pulse-interactive {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

.toggle-count-visibility {
    animation: pulse-interactive 2s infinite;
}

/* Adattamenti responsive */
@media (max-width: 768px) {
    #prominent-count-display {
        width: 110px;
        height: 110px;
    }

    #prominent-count-value {
        font-size: 2.8rem;
    }
    
    .count-label {
        font-size: 0.8rem;
    }
    
    .toggle-count-visibility {
        top: -28px;
        font-size: 0.9rem;
        padding: 4px 8px;
    }
    
    .toggle-count-visibility::after {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    #prominent-count-container {
        margin: 0.8rem auto;
    }
    
    #prominent-count-display {
        width: 100px;
        height: 100px;
    }

    #prominent-count-value {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .count-label {
        font-size: 0.75rem;
    }
    
    .toggle-count-visibility {
        top: -25px;
        padding: 3px 6px;
    }
    
    .toggle-count-visibility::after {
        content: 'Tap';
        font-size: 0.65rem;
    }
}

@media (max-width: 360px) {
    #prominent-count-display {
        width: 90px;
        height: 90px;
    }

    #prominent-count-value {
        font-size: 2.5rem;
    }
}

/* Animazioni che erano state rimosse */
@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.count-circle-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    pointer-events: none;
    animation: ripple 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes ripple {
    0% {
        width: 0%;
        height: 0%;
        opacity: 0.5;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* Enhanced feedback styling for more prominence */
.feedback-message.enhanced-feedback {
    padding: 1.5rem;
    margin: 1rem 0;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-width: 2px;
    transition: all 0.3s ease;
    animation: feedback-pulse 2s infinite;
}

.feedback-message.enhanced-feedback.success {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.feedback-message.enhanced-feedback.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.feedback-message.enhanced-feedback.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
}

@keyframes feedback-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Count change flash effects */
@keyframes count-increase-flash {
    0% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 50px rgba(40, 167, 69, 0.8), inset 0 0 30px rgba(40, 167, 69, 0.5); }
    100% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3); }
}

@keyframes count-decrease-flash {
    0% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 50px rgba(220, 53, 69, 0.8), inset 0 0 30px rgba(220, 53, 69, 0.5); }
    100% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3); }
}

#prominent-count-display.count-increased {
    animation: count-increase-flash 1s ease-out;
}

#prominent-count-display.count-decreased {
    animation: count-decrease-flash 1s ease-out;
}

#prominent-count-display.count-increased #prominent-count-value {
    animation: text-pulse-green 1s ease-out;
}

#prominent-count-display.count-decreased #prominent-count-value {
    animation: text-pulse-red 1s ease-out;
}

@keyframes text-pulse-green {
    0% { color: #f0d060; transform: scale(1); }
    50% { color: var(--success-color); transform: scale(1.2); }
    100% { color: #f0d060; transform: scale(1); }
}

@keyframes text-pulse-red {
    0% { color: #f0d060; transform: scale(1); }
    50% { color: var(--error-color); transform: scale(1.2); }
    100% { color: #f0d060; transform: scale(1); }
}

/* Also add a more obvious styling for the verification feedback */
#rc-quiz-modal .feedback-message {
    transition: all 0.3s ease;
}

#rc-quiz-modal .feedback-message.enhanced-feedback {
    font-size: 1.2rem;
    padding: 1.8rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* True Count hint styling */
.tc-hint {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    opacity: 0.9;
    font-weight: 600;
}

/* Count reference in feedback */
.count-reference {
    margin-top: 1.2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    font-family: var(--font-main);
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.feedback-message.success .count-reference {
    border-color: rgba(40, 167, 69, 0.3);
}

.feedback-message.error .count-reference {
    border-color: rgba(220, 53, 69, 0.3);
}

/* Enhance quiz modal for better visibility */
#rc-quiz-modal .modal-content {
    max-width: 500px;
}

#rc-quiz-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#rc-quiz-modal p {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Improve feedback message styling for better visibility */
.feedback-message {
    text-align: center;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    min-height: 3.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
    opacity: 0;
}

.feedback-message:not(:empty) {
    opacity: 1;
}

.feedback-message.enhanced-feedback {
    padding: 1.8rem 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.2rem;
    animation: feedback-pulse 2.5s infinite;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-width: 2px;
    transform: scale(1.02);
    max-width: 100%;
}

.feedback-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.feedback-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.feedback-message.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.feedback-message strong {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.7rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Enhanced count reference box */
.count-reference {
    margin-top: 1.2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    font-family: var(--font-main);
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.feedback-message.success .count-reference {
    border-color: rgba(40, 167, 69, 0.3);
}

.feedback-message.error .count-reference {
    border-color: rgba(220, 53, 69, 0.3);
}

/* Better button visibility in quiz modal */
#rc-quiz-modal .quiz-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

#rc-quiz-modal .btn-primary,
#rc-quiz-modal .btn-secondary {
    min-height: 50px;
    padding: 0.8rem 1.2rem;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

#rc-quiz-modal .btn-primary:hover,
#rc-quiz-modal .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

#rc-quiz-modal .btn-primary:active,
#rc-quiz-modal .btn-secondary:active {
    transform: translateY(1px);
}

/* Make the restart button stand out */
#restartSessionBtn {
    background: var(--gradient-gold);
    color: var(--dashboard-bg);
    font-weight: 700;
    animation: button-pulse 1.5s infinite;
    margin-top: 1rem;
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes button-pulse {
    0% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(212, 175, 55, 0.6); }
    100% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); }
}

#restartSessionBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
}

#restartSessionBtn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

/* Enhance the quiz UI feedback */

#showResultBtn {
    background-color: var(--success-color);
    color: white;
    font-weight: 600;
}

/* Make modal more prominent */
#rc-quiz-modal .modal-content {
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
    animation: modal-glow 2s infinite alternate;
}

@keyframes modal-glow {
    from { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3); }
    to { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 35px rgba(212, 175, 55, 0.5); }
}

/* Add debug outline to feedback message to ensure visibility */
#rc-quiz-feedback:not(:empty) {
    border: 2px dashed rgba(212, 175, 55, 0.5);
    max-width: 100%;
    overflow: visible;
    display: block;
}

/* Ensure the quiz buttons layout is always vertical on mobile */
@media (max-width: 768px) {
    #rc-quiz-modal .quiz-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #rc-quiz-modal .quiz-buttons button {
        width: 100%;
    }
    
    #rc-quiz-modal .feedback-message {
        padding: 1.2rem 0.8rem;
    }
}

/* Add styles to make errors more obvious */
.error-highlight {
    color: #ff3333 !important;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5) !important;
    animation: error-pulse 1s infinite !important;
}

@keyframes error-pulse {
    0% { opacity: 1; text-shadow: 0 0 10px rgba(255, 51, 51, 0.5); }
    50% { opacity: 0.8; text-shadow: 0 0 20px rgba(255, 51, 51, 0.8); }
    100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 51, 51, 0.5); }
}

/* Shake animation for wrong answers */
.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both !important;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* Flash effect for the modal on wrong answers */
.flash-error {
    animation: flash-error 0.5s ease-out !important;
}

@keyframes flash-error {
    0% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3); background-color: var(--card-bg); }
    20% { box-shadow: 0 10px 30px rgba(255, 51, 51, 0.5), 0 0 40px rgba(255, 51, 51, 0.5); background-color: rgba(30, 0, 0, 0.9); }
    100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3); background-color: var(--card-bg); }
}

/* Make feedback for wrong answers more prominent */
.feedback-message.error.enhanced-feedback {
    background: rgba(255, 51, 51, 0.15) !important;
    border: 2px solid rgba(255, 51, 51, 0.4) !important;
    box-shadow: 0 8px 20px rgba(255, 51, 51, 0.3) !important;
}

/* Make the correct Running Count really stand out in error messages */
.count-reference.error-highlight {
    background: rgba(30, 0, 0, 0.5) !important;
    border: 2px solid rgba(255, 51, 51, 0.5) !important;
    font-weight: 700 !important;
}

.count-reference.error-highlight::before {
    content: "❌";
    margin-right: 0.5rem;
}

.dealer-area.pulse-highlight {
    animation: pulseHighlight 1.5s ease infinite;
    z-index: 2;
    box-shadow: 0 0 0 3px var(--accent-color), 0 0 25px rgba(212, 175, 55, 0.7);
    transform: translateY(-5px) scale(1.03);
    border-radius: var(--border-radius);
}

.dealer-area.pulse-highlight::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    margin-left: -8px;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.9);
}

/* Stile per il dealer quando è attivo (in blu) */
.dealer-area.active {
    border: 2px solid #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    background-color: rgba(52, 152, 219, 0.1);
    position: relative;
    z-index: 1;
    transform: translateY(-3px); /* Leggero sollevamento per evidenziare */
}

.dealer-area .hand-value {
    font-size: 0.7rem;
    color: var(--accent-light);
    margin-top: 0.3rem;
    padding: 0.2rem 0.4rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    letter-spacing: 0.3px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
