/* ===== BASE STYLES ===== */
:root {
    --primary-color: #0a0e17;
    --secondary-color: #1a2138;
    --accent-color: #d4af37; /* Gold */
    --accent-dark: #b59530;
    --accent-light: #f0e6c2;
    --text-primary: #ffffff;
    --text-secondary: #b8c2cc;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --box-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f0e6c2 100%);
    --gradient-dark: linear-gradient(135deg, #0a0e17 0%, #1a2138 100%);
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', serif;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    font-size: 16px;
    scroll-behavior: smooth;
  }
  
  body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background: var(--primary-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
      radial-gradient(circle at 10% 20%, rgba(26, 33, 56, 0.8) 0%, transparent 20%),
      radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.15) 0%, transparent 20%);
  }
  
  /* ===== TYPOGRAPHY ===== */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
  }
  
  h1 {
    font-size: 2.5rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  h2 {
    font-size: 2rem;
    color: var(--accent-color);
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
  }
  
  h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: 3px;
  }
  
  h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
  }
  
  p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
  }
  
  small {
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
  
  /* ===== LAYOUT & CONTAINERS ===== */
  .dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--primary-color);
  }
  
  .sidebar {
    width: 280px;
    background: var(--secondary-color);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed) ease;
    transform: translateX(0);
  }
  
  .sidebar.collapsed {
    transform: translateX(-100%);
  }
  
  .main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left var(--transition-speed) ease;
  }
  
  .main-content.expanded {
    margin-left: 0;
  }
  
  .dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  }
  
  .training-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .page-header {
    margin-bottom: 3rem;
    text-align: center;
  }
  
  .page-header p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
  }
  
  /* ===== SIDEBAR STYLES ===== */
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
  }
  
  .close-sidebar {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
  }
  
  .close-sidebar:hover {
    color: var(--text-primary);
  }
  
  .user-info {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
  }
  
  .user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
  }
  
  .user-details p {
    margin-bottom: 0.25rem;
  }
  
  .user-name {
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .user-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
  }
  
  .plan-badge {
    background: var(--gradient-gold);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
  }
  
  .sidebar-nav ul {
    list-style: none;
  }
  
  .sidebar-nav li {
    margin-bottom: 0.5rem;
  }
  
  .sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
  }
  
  .sidebar-nav a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
  }
  
  .sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
  }
  
  .sidebar-nav .active a {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
  }
  
  .sidebar-nav .logout {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
  }
  
  .sidebar-nav .logout a {
    color: var(--error-color);
  }
  
  .sidebar-nav .logout a:hover {
    background-color: #DA2C38;
    color: #fff;
  }
  
  
  .header-actions {
    display: flex;
    align-items: center;
  }
  
  .notifications {
    margin-right: 1.5rem;
    position: relative;
  }
  
  .notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
  }
  
  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
  }
  
  .user-dropdown {
    position: relative;
  }
  
  .user-dropdown-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
  }
  
  .user-dropdown-btn i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
  }
  
  .user-dropdown-btn i.fa-chevron-down {
    margin-left: 0.5rem;
    font-size: 0.75rem;
  }
  
  
  /* ===== TRAINING MODE SELECTION ===== */
  .training-mode-selection {
    margin-bottom: 3rem;
  }
  
  .training-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
  }
  
  .mode-card {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
  }
  
  .mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    z-index: 0;
  }
  
  .mode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: rgba(212, 175, 55, 0.3);
  }
  
  .mode-card:hover::before {
    opacity: 0.1;
  }
  
  .mode-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--accent-color);
    position: relative;
    z-index: 1;
  }
  
  .mode-card h3 {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
  }
  
  .mode-card p {
    font-size: 14px;
    color: #c8d3f5;
    margin: 0;
    line-height: 1.5;
  }
  
  /* ===== TRAINING CONFIGURATION ===== */
  #training-config {
    display: none;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    scroll-margin-top: 80px; /* Adjust as needed for header height */
  }
  
  .config-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
  }
  
  .config-group-section {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  /* Nuovo stile per la sezione di opzioni principali */
  .primary-options {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .primary-options h3 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .primary-options .config-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .primary-options .config-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  
  .primary-options .config-group label {
    color: var(--accent-light);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
  }
  
  .primary-options select {
    border-color: rgba(212, 175, 55, 0.3);
  }
  
  /* Stili per l'accordion delle opzioni avanzate */
  .advanced-options {
    background: rgba(0, 0, 0, 0.2);
  }
  
  .section-accordion h3 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    position: relative;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  }
  
  .section-accordion h3::after {
    display: none;
  }
  
  .toggle-icon {
    transition: transform 0.3s ease;
  }
  
  .section-accordion.open .toggle-icon {
    transform: rotate(180deg);
  }
  
  .accordion-content {
    display: block; /* Sempre visibile */
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    transition: opacity 0.3s ease;
  }
  
  .config-group-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    position: relative;
  }
  
  .config-group-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gradient-gold);
    border-radius: 2px;
  }
  
  .config-group {
    margin-bottom: 1.5rem;
  }
  
  .config-group:last-child {
    margin-bottom: 0;
  }
  
  .config-description {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
  }
  
  .config-description i {
    color: var(--accent-color);
    margin-right: 0.5rem;
    font-size: 0.9rem;
    margin-top: 0.1rem;
  }
  
  .config-description span {
    flex: 1;
  }
  
  .config-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
  }
  
  .config-group select,
  .config-group input[type="number"],
  .config-group input[type="range"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: all var(--transition-speed) ease;
  }
  
  .config-group select:focus,
  .config-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  }
  
  .custom-speed-input,
  .custom-time-input {
    margin-top: 1rem;
  }
  
  .custom-time-input {
    display: flex;
    align-items: center;
  }
  
  .custom-time-input input {
    flex: 1;
    margin-right: 0.5rem;
  }
  
  .custom-time-input span {
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
  
  .range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
  
  .config-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    gap: 1rem;
  }
  
  /* ===== BUTTON STYLES ===== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    font-family: var(--font-main);
  }
  
  .btn-primary {
    background: var(--gradient-gold);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  }
  
  .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
  }
  
  .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
  }
  
  /* ===== TRAINING ARENA ===== */
  .training-arena-container {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .arena-stats {
    display: flex;
    gap: 2rem;
  }
  
  .stat {
    text-align: center;
  }
  
  .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
  }
  
  .arena-actions {
    display: flex;
    gap: 0.75rem;
  }
  
  /* ===== CARD AREA ===== */
  .card-area {
    min-height: 360px;
    padding: 60px;
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible !important;
  }
  
  .cards-container {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px;
    overflow: visible !important;
  }
  
  /* Contenitore per ogni singola carta per garantire spazio adeguato */
  .card-wrapper {
    padding: 20px;
    margin: 10px;
    position: relative;
    overflow: visible !important;
    height: 240px;
    width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* ===== PLAYING CARD STYLES ===== */
  .playing-card {
    width: 140px;
    height: 200px;
    border-radius: 10px;
    background: white;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: 0;
    overflow: visible !important;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    cursor: pointer;
    color: #333;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    z-index: 20;
  }
  
  .playing-card.red {
    color: #d40000;
  }
  
  .playing-card.black {
    color: #333;
  }
  
  .card-rank {
    font-size: 2.5rem;
    font-weight: 700;
    z-index: 2;
  }
  
  .card-suit {
    font-size: 1.5rem;
    position: absolute;
    z-index: 2;
  }
  
  .top-left {
    position: absolute;
    top: 10px;
    left: 10px;
    text-align: center;
    line-height: 1;
    z-index: 2;
  }
  
  .bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    text-align: center;
    line-height: 1;
    transform: rotate(180deg);
    z-index: 2;
  }
  
  /* Dimensioni carte corrette */
  .playing-card.small {
    width: 110px;
    height: 160px;
  }
  
  .playing-card.medium {
    width: 140px;
    height: 200px;
  }
  
  .playing-card.large {
    width: 170px;
    height: 250px;
  }
  
  /* Card style variations */
  .playing-card.stylized {
    background: white;
    border: 1px solid #eee;
  }
  
  .playing-card.noisy {
    position: relative;
    overflow: hidden;
  }
  
  .playing-card.noisy .distraction-text {
    position: absolute;
    color: rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    pointer-events: none;
  }
  
  .playing-card.premium {
    background: linear-gradient(135deg, #f9f9f9 0%, #e6e6e6 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  }
  
  .playing-card.casino {
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  }
  
  /* Card animations */
  .card-appear-animation {
    animation: cardAppear 0.3s ease-out forwards;
    transform-origin: center center;
  }
  
  @keyframes cardAppear {
    0% {
      transform: translateY(10px) scale(0.95);
      opacity: 0.5;
    }
    100% {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
  }
  
  /* ===== TRAINING MODE SPECIFIC STYLES ===== */
  /* Flashcard Mode */
  .flashcard-controls {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.07);
    border-top: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .value-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  #next-card-btn {
    margin-top: 0.5rem;
    min-width: 180px;
  }
  
  .value-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
  }
  
  .value-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
  }
  
  .value-btn.selected {
    background: var(--gradient-gold);
    color: var(--primary-color);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
  }
  
  .value-btn.answer-correct {
    background: var(--success-color);
    color: white;
    border-color: transparent;
  }
  
  .value-btn.answer-incorrect {
    background: var(--error-color);
    color: white;
    border-color: transparent;
    animation: shake 0.5s ease-in-out;
    opacity: 0.9;
  }
  
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
  }
  
  .feedback-message {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    min-height: 2.5em;
    visibility: hidden;
    transition: visibility 0s, opacity 0.3s ease;
    opacity: 0;
  }
  
  .feedback-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
    font-weight: 600;
    padding: 10px 15px;
  }
  
  .feedback-message.visible {
    visibility: visible;
    opacity: 1;
    z-index: 10;
  }
  
  .feedback-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
  }
  
  /* Sequence Mode */
  .sequence-mode {
    padding: 2rem;
    text-align: center;
    position: relative;
    padding-top: 10px; /* Minimal padding since we're hiding the header */
    padding-bottom: 150px; /* Increased to make room for control buttons */
  }
  
  .cards-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    margin-top: 130px; /* Make room for the header */
  }
  
  .sequence-input {
    text-align: center;
  }
  
  /* When in sequence mode, hide the arena header but keep control buttons */
  .training-arena-container.sequence-mode .arena-header {
    display: none;
  }
  
  /* Ensure the timer stat is visible in sequence mode */
  .training-arena-container.sequence-mode .arena-header .stat {
    display: none;
  }
  
  .training-arena-container.sequence-mode .arena-header .stat:first-child {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 60;
    background: rgba(26, 33, 56, 0.8);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
  }
  
  /* Hide the central table controls in sequence mode */
  .training-arena-container.sequence-mode .table-controls {
    display: none !important;
  }
  
  /* Hide the entire card-area in sequence mode */
  .training-arena-container.sequence-mode .card-area {
    display: none !important;
  }
  
  /* Sequence mode bottom controls */
  .sequence-mode-bottom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70; /* Ensure it's above other elements but below modals */
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 0.75rem; /* Reduced padding */
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
    gap: 0.5rem; /* Reduced gap between children */
  }
  
  /* Adjustments for sequence-input within the new container */
  .sequence-mode-bottom-controls .sequence-input {
    position: static; /* Override any fixed positioning */
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
  }
  
  /* Controls for sequence mode */
  .sequence-table-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0;
  }
  
  /* Make input more prominent */
  .input-button-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .input-button-group input {
    width: 150px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
  }
  
  .input-button-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  }
  
  #running-count-input.answer-correct {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
  }
  
  #running-count-input.answer-incorrect {
    border-color: var(--error-color);
    background: rgba(220, 53, 69, 0.1);
  }
  
  /* Timer per la sessione corrente per sequence mode */
  #sequence-elapsed-time {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 60;
    background: rgba(26, 33, 56, 0.8);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  /* Media queries for responsive design */
  @media (max-width: 768px) {
    .sequence-mode-bottom-controls {
      padding: 0.5rem;
    }
    
    .sequence-mode-bottom-controls .sequence-input,
    .sequence-mode-bottom-controls .sequence-table-controls {
      width: 100%;
      padding: 0.25rem 0;
    }
    
    .sequence-mode-bottom-controls .input-button-group {
      flex-direction: column;
      width: 100%;
    }
    
    .sequence-mode-bottom-controls .input-button-group input {
      width: 100%;
      margin-bottom: 0.5rem;
    }
  }
  
  /* Reverse Mode */
  .reverse-container {
    padding: 2rem;
    text-align: center;
    position: relative;
    padding-top: 10px; /* Minimal padding since we're hiding the header */
    padding-bottom: 150px; /* Increased to make room for control buttons */
  }
  
  /* When in reverse mode, hide the arena header but keep control buttons */
  .training-arena-container.reverse-mode .arena-header {
    display: none;
  }
  
  /* Ensure the timer stat is visible in reverse mode */
  .training-arena-container.reverse-mode .arena-header .stat {
    display: none;
  }
  
  .training-arena-container.reverse-mode .arena-header .stat:first-child {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 60;
    background: rgba(26, 33, 56, 0.8);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
  }
  
  /* Hide the central table controls in reverse mode */
  .training-arena-container.reverse-mode .table-controls {
    display: none !important;
  }
  
  /* Hide the entire card-area in reverse mode */
  .training-arena-container.reverse-mode .card-area {
    display: none !important;
  }
  
  /* Create special table controls for reverse mode */
  .reverse-table-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 10px;
    background: rgba(26, 33, 56, 0.8);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
  }
  
  /* Timer per la sessione corrente */
  .elapsed-time-display {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 60;
    background: rgba(26, 33, 56, 0.8);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  .elapsed-time-display i {
    color: var(--accent-color);
  }
  
  /* Ensure the controls don't overlap with the counter text */
  .final-count-display {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 1rem;
    padding-left: 140px; /* Make room for the timer on the left */
    padding-right: 140px; /* Make room for the controls on the right */
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin: 0;
    backdrop-filter: blur(5px);
    text-align: center;
  }
  
  #final-count {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin: 0.5rem 0;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }
  
  #final-count.answer-correct {
    color: var(--success-color);
  }
  
  #final-count.answer-incorrect {
    color: var(--error-color);
  }
  
  .verify-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: fixed;
    bottom: 80px; /* Adjusted to make room for control buttons below */
    left: 0;
    right: 0;
    z-index: 70;
    padding: 1rem;
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
  }
  
  /* Make buttons more prominent */
  .verify-buttons button {
    min-width: 150px;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .verify-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  /* Improve card sequence layout - always 3 per row on desktop */
  #reverse-sequence-display.cards-sequence {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Mobile-specific styles */
  @media (max-width: 768px) {
    .reverse-container {
        padding-top: 10px;
        padding-bottom: 130px; /* Increased to make room for control buttons */
    }
    
    .final-count-display {
        padding-left: 10px;
        padding-right: 10px;
        padding: 0.75rem;
    }
    
    #reverse-sequence-display.cards-sequence {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .card-wrapper {
        padding: 10px;
        margin: 5px;
        height: 200px;
        width: 150px;
    }

    .playing-card.small {
        width: 90px;
        height: 130px;
    }

    #final-count {
        font-size: 2.5rem;
        margin: 0.5rem 0;
    }
    
    .reverse-table-controls {
        position: fixed;
        top: auto;
        bottom: 10px;
        left: 0;
        right: 0;
        justify-content: center;
        z-index: 60;
        padding: 10px;
        background: rgba(26, 33, 56, 0.8);
        border-top: 1px solid rgba(212, 175, 55, 0.2);
    }

    .verify-buttons {
        bottom: 70px; /* Push up to make space for the control buttons */
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .verify-buttons button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .elapsed-time-display {
        top: 10px;
        bottom: auto;
        left: auto;
        right: 10px;
        transform: none;
        z-index: 65;
        font-size: 0.85rem;
        padding: 6px 10px;
    }
  }
  
  /* ===== TRAINING RESULTS ===== */
  .training-results {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
  }
  
  .result-stat {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .result-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-color);
  }
  
  .result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
  }
  
  .result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  .errors-section {
    margin-bottom: 2rem;
  }
  
  .error-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .error-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .error-item:last-child {
    border-bottom: none;
  }
  
  .error-card {
    width: 50px;
    height: 70px;
    margin-right: 1rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: white;
    color: #333;
    font-size: 1.25rem;
  }
  
  .error-card.red {
    color: #d40000;
  }
  
  .error-card.black {
    color: #333;
  }
  
  .error-message {
    flex: 1;
    font-size: 0.9rem;
  }
  
  .error-message strong {
    color: var(--text-primary);
  }
  
  .results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
  }
  
  .review-table tr.error-row td:last-child::after {
    content: '❌';
    margin-left: 0.5rem;
  }
  
  .review-modal-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
  }
  
  /* ===== PREMIUM/PRO MODE STYLES ===== */
  .pro-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(212, 175, 55, 0.2);
  }
  
  .toggle-label {
    margin-right: 1rem;
    font-weight: 500;
    color: var(--accent-color);
  }
  
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
  }
  
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
  }
  
  .toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
  }
  
  input:checked + .toggle-slider {
    background: var(--gradient-gold);
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(26px);
    background: var(--primary-color);
  }
  
  /* Integrated Professional Training Area */
  .integrated-training-area {
    display: none;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(212, 175, 55, 0.2);
  }
  
  .training-header.premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(90deg, rgba(10, 14, 23, 0.8) 0%, rgba(26, 33, 56, 0.8) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
  }
  
  .training-stats {
    display: flex;
    gap: 2rem;
  }
  
  .stat.premium {
    text-align: center;
    min-width: 120px;
  }
  
  .stat.premium .stat-label {
    font-size: 0.75rem;
    color: var(--accent-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .stat.premium .stat-value {
    font-size: 1.5rem;
    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;
  }
  
  .mode-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  
  .current-mode-pill {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
  }
  
  .current-mode-pill i {
    margin-right: 0.5rem;
    color: var(--accent-color);
  }
  
  .skill-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .level-indicator {
    padding: 0.25rem 0.75rem;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 20px;
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 600;
  }
  
  .training-controls.premium {
    display: flex;
    gap: 0.75rem;
  }
  
  .btn-icon.premium {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: all var(--transition-speed) ease;
  }
  
  .btn-icon.premium:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
  }
  
  .card-area.premium {
    padding: 2rem;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(rgba(10, 14, 23, 0.7), rgba(10, 14, 23, 0.9)), 
                url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,10 L70,10 L90,30 L90,70 L70,90 L30,90 L10,70 L10,30 Z" fill="none" stroke="%23d4af37" stroke-width="0.5" opacity="0.1"/></svg>');
    background-size: 100px;
  }
  
  .casino-ambience {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
  }
  
  .integrated-container {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .dynamic-card-display {
    margin-bottom: 2rem;
    perspective: 1000px;
  }
  
  .control-set {
    margin-top: 2rem;
    width: 100%;
    max-width: 500px;
  }
  
  .value-buttons.premium {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
  }
  
  .value-btn.premium {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(212, 175, 55, 0.3);
    color: var(--accent-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  
  .value-btn.premium:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
  }
  
  .count-input {
    display: flex;
    gap: 1rem;
  }
  
  .count-input input {
    flex: 1;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1.5rem;
    text-align: center;
    font-weight: 700;
  }
  
  .count-input input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  }
  
  .btn-gold {
    background: var(--gradient-gold);
    color: var(--primary-color);
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
  }
  
  .btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
  }
  
  .feedback-display {
    margin-top: 2rem;
    min-height: 50px;
    width: 100%;
    text-align: center;
  }
  
  .feedback-message {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: inline-block;
  }
  
  .progression-indicators {
    width: 100%;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
  }
  
  .skill-progress-container,
  .session-progress-container {
    margin-bottom: 1rem;
  }
  
  .skill-label,
  .progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
  }
  
  .skill-progress-bar,
  .session-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
  }
  
  .skill-progress,
  .session-progress {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 4px;
    transition: width 0.5s ease;
  }
  
  .analytics-panel {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
  }
  
  .panel-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
  }
  
  .panel-header h3 {
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--accent-color);
  }
  
  .toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
  }
  
  .toggle-btn:hover {
    color: var(--text-primary);
  }
  
  .panel-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
  }
  
  .analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .analytics-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .item-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
  }
  
  .item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .performance-charts {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
  }
  
  .mini-chart {
    flex: 1;
    height: 150px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  /* Enhanced Results Modal */
  .enhanced-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
  }
  
  .modal-content.premium {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
  }
  
  .modal-header.premium {
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, rgba(10, 14, 23, 0.8) 0%, rgba(26, 33, 56, 0.8) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .modal-header.premium h2 {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0;
  }
  
  .close-modal.premium {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
  }
  
  .close-modal.premium:hover {
    color: var(--accent-color);
  }
  
  .modal-body.premium {
    padding: 2rem;
  }
  
  .results-summary.premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
  }
  
  .result-stat.premium {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all var(--transition-speed) ease;
  }
  
  .result-stat.premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }
  
  .result-icon.premium {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
    border: 2px solid rgba(212, 175, 55, 0.3);
  }
  
  .result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .performance-analysis {
    margin-bottom: 3rem;
  }
  
  .performance-analysis h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
  }
  
  .performance-charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
  }
  
  .chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .chart-container h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
  }
  
  .chart {
    height: 250px;
    width: 100%;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
  }
  
  .skill-assessment {
    margin-bottom: 3rem;
  }
  
  .skill-assessment h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
  }
  
  .skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .skill-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .skill-name {
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
  }
  
  .skill-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
  }
  
  .skill-bar {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 4px;
    width: 0;
    transition: width 1s ease;
  }
  
  .skill-rating {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
  }
  
  .improvement-areas {
    margin-bottom: 2rem;
  }
  
  .improvement-areas h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
  }
  
  .improvement-suggestions {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .improvement-suggestions p {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
  }
  
  .improvement-suggestions p::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
  }
  
  .modal-footer.premium {
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, rgba(10, 14, 23, 0.8) 0%, rgba(26, 33, 56, 0.8) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: space-between;
  }
  
  /* ===== TABLE ENVIRONMENTS ===== */
  .classic-table {
    background: linear-gradient(135deg, #1a2a3a 0%, #0e1a2b 100%);
    border: 15px solid #5d4037;
    border-radius: 50%;
    box-shadow: 0 0 0 10px #8d6e63, 
                inset 0 0 20px rgba(0, 0, 0, 0.5);
  }
  
  .casino-environment {
    background: linear-gradient(135deg, #0a3d62 0%, #082c4d 100%);
    border: 20px solid #1e3d59;
    border-radius: 50%;
    box-shadow: 0 0 0 15px #254e7b, 
                inset 0 0 30px rgba(0, 0, 0, 0.7),
                0 0 50px rgba(0, 0, 0, 0.5);
  }
  
  .premium-vip {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 25px solid #0f3460;
    border-radius: 50%;
    box-shadow: 0 0 0 20px #533483, 
                inset 0 0 50px rgba(212, 175, 55, 0.3),
                0 0 100px rgba(212, 175, 55, 0.3);
  }
  
  /* ===== ANIMATIONS & TRANSITIONS ===== */
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  @keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
  }
  
  .pulse-animation {
    animation: pulse 2s infinite;
  }
  
  .float-animation {
    animation: float 3s ease-in-out infinite;
  }
  
  /* ===== RESPONSIVE STYLES ===== */
  @media (max-width: 1200px) {
    .sidebar {
      width: 250px;
    }
    
    .main-content {
      margin-left: 250px;
    }
  }
  
  @media (max-width: 992px) {
    .sidebar {
      transform: translateX(-100%);
    }
    
    .sidebar.collapsed {
      transform: translateX(0);
    }
    
    .main-content {
      margin-left: 0;
    }
    
    
    .review-modal-body {
      flex-direction: column;
    }
    
    .review-details {
      width: 100%;
      border-left: none;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
  }
  
  @media (max-width: 768px) {
    .training-modes {
      grid-template-columns: 1fr;
    }
    
    .config-form {
      grid-template-columns: 1fr;
    }
    
    .arena-stats {
      flex-wrap: wrap;
      gap: 1rem;
    }
    
    .stat {
      min-width: calc(50% - 1rem);
    }
    
    .performance-charts-container {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 576px) {
    h1 {
      font-size: 2rem;
    }
    
    h2 {
      font-size: 1.75rem;
    }
    
    .training-main {
      padding: 1rem;
    }
    
    .results-summary {
      grid-template-columns: 1fr;
    }
    
    .verify-buttons {
      flex-direction: column;
    }
    
    .modal-footer.premium {
      flex-direction: column;
      gap: 1rem;
    }
  }
  
  /* ===== UTILITY CLASSES ===== */
  .text-gold {
    color: var(--accent-color);
  }
  
  .bg-dark {
    background: var(--secondary-color);
  }
  
  .shadow-gold {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
  }
  
  .border-gold {
    border: 1px solid var(--accent-color);
  }
  
  /* ===== LOADING ANIMATION ===== */
  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  .table-btn {
    background: linear-gradient(90deg, #d4af37 0%, #b59530 100%);
    color: #0a0e17;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 16px;
    padding: 0.4rem 1.1rem;
    margin: 0 0.25rem;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.10);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
    min-width: unset;
    min-height: unset;
  }
  .table-btn i {
    font-size: 1.1em;
  }
  .table-btn:hover, .table-btn:focus {
    background: linear-gradient(90deg, #f0e6c2 0%, #d4af37 100%);
    color: #0a0e17;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.18);
    outline: none;
  }

  /* Utility classes for hiding elements */
  .hide-running-count #running-count-stat {
    display: none;
  }

  .hide-accuracy #accuracy-stat {
    display: none;
  }

  /* Stili per il countdown overlay */
  .countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .countdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none !important;
    outline: none !important;
  }

  #countdown-number {
    font-size: 8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    animation: pulse 1s infinite;
    border: none !important;
    outline: none !important;
  }

  #countdown-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none !important;
    outline: none !important;
  }

  @keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
  }

  .table-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    opacity: 0.05;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d4af37"><path d="M12 2L4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5l-8-3zm-1.06 13.54L7.4 12l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41-5.64 5.66z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 0;
  }

  /* Input for the correct value in reverse mode */
  .correct-value-input {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 1rem;
    z-index: 70;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
    animation: slideInUp 0.3s ease-out;
  }

  .input-button-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .input-button-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    max-width: 180px;
    text-align: center;
  }

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

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

  /* Adjust the positions of buttons when the input field is visible */
  .correct-value-input-visible .verify-buttons {
    opacity: 0;
    pointer-events: none;
  }

  .correct-value-input-visible .reverse-table-controls {
    bottom: 140px;
  }

  /* Mobile-specific styles */
  @media (max-width: 768px) {
    .correct-value-input {
        padding: 0.75rem;
    }
    
    .input-button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .input-button-group input {
        width: 100%;
        max-width: 220px;
        margin-bottom: 0.5rem;
    }
    
    .correct-value-input-visible .reverse-table-controls {
        bottom: 160px;
    }
  }

  /* Special styling for the new bottom controls container in Reverse Mode */
  .reverse-mode-bottom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70; /* Ensure it's above other elements but below modals */
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 0.75rem; /* Reduced padding */
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
    gap: 0.5rem; /* Reduced gap between children */
  }

  /* Adjustments for verify-buttons within the new container */
  .reverse-mode-bottom-controls .verify-buttons {
    position: static; /* Override fixed positioning */
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0; /* Remove individual padding */
    background: none; /* Remove individual background */
    border-top: none; /* Remove individual border */
    backdrop-filter: none; /* Remove individual backdrop filter */
    width: 100%; /* Make it take full width for centering buttons */
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  /* Adjustments for reverse-table-controls within the new container */
  .reverse-mode-bottom-controls .reverse-table-controls {
    position: static; /* Override fixed positioning */
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0; /* Remove individual padding */
    background: none; /* Remove individual background */
    border-top: none; /* Remove individual border */
    width: 100%; /* Make it take full width for centering buttons */
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  /* Adjustments for correct-value-input within the new container */
  .reverse-mode-bottom-controls .correct-value-input {
    position: static; /* Override fixed positioning */
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0; /* Remove individual padding */
    background: none; /* Remove individual background */
    border-top: none; /* Remove individual border */
    backdrop-filter: none; /* Remove individual backdrop filter */
    width: 100%; /* Make it take full width */
    max-width: 400px; /* Optional: constrain width */
    animation: none; /* Remove previous animation if not needed */
  }

  .reverse-mode-bottom-controls .correct-value-input p {
      margin-bottom: 0.5rem; /* Adjust spacing */
  }

  /* Ensure the main reverse container doesn't have extra padding at the bottom */
  .reverse-container {
    /* padding-bottom: 10px; Remove or adjust if it causes issues with the new fixed footer */
    /* The new fixed footer 'reverse-mode-bottom-controls' will occupy the bottom space */
  }

  /* Hide the old individual reverse-table-controls if it was previously fixed and not part of the new group */
  /* This might not be needed if HTML structure is strictly followed, but good for cleanup */
  .reverse-container > .reverse-table-controls {
      display: none !important; /* Hide if it's a direct child and not in the new group */
  }

  /* Adjustments for when the correct-value-input is visible */
  /* No longer need to adjust .reverse-table-controls position as they are in a flex column */
  .correct-value-input-visible .verify-buttons {
    opacity: 0;
    pointer-events: none;
    height: 0; /* Collapse it to remove space */
    overflow: hidden; /* Hide content when collapsed */
    margin: 0;
    padding: 0;
  }

  /* Mobile-specific adjustments for the new bottom controls container */
  @media (max-width: 768px) {
    .reverse-mode-bottom-controls {
      padding: 0.5rem;
      gap: 0.5rem;
    }

    .reverse-mode-bottom-controls .verify-buttons,
    .reverse-mode-bottom-controls .reverse-table-controls {
      gap: 0.5rem;
    }

    .reverse-mode-bottom-controls .verify-buttons button,
    .reverse-mode-bottom-controls .reverse-table-controls .table-btn {
      padding: 0.5rem 0.75rem;
      font-size: 0.85rem;
    }

    .reverse-mode-bottom-controls .correct-value-input {
      max-width: 100%; /* Full width on mobile */
    }
    
    .correct-value-input-visible .verify-buttons {
      /* Ensure it still collapses on mobile */
      height: 0;
      overflow: hidden;
    }
  }

  /* Remove fixed positioning from original .reverse-table-controls and .verify-buttons as they are now child elements */
  /* This might be redundant if the specific selectors above handle it, but ensures cleanup */
  .reverse-table-controls,
  .verify-buttons,
  .correct-value-input {
      /* These were previously fixed, ensure they are not if not part of the new group directly */
      /* This is a general catch-all, the specific overrides inside .reverse-mode-bottom-controls are more targeted */
  }

  /* Ensure reverse-container has enough bottom padding so content doesn't hide behind the new fixed footer */
  .reverse-container {
    padding-bottom: 150px; /* Adjust this value based on the height of reverse-mode-bottom-controls */
  }

  /* When correct-value-input is visible, we might need more padding if its height changes */
  .training-arena-container.correct-value-input-visible .reverse-container {
    padding-bottom: 200px; /* Example: Increased padding when input is shown */
  }

  /* Reverse Mode - Feedback Message Positioning */
  .training-arena-container.reverse-mode #training-feedback {
    position: fixed;
    top: auto; /* Remove top positioning */
    bottom: auto; /* Remove any bottom positioning */
    left: 0;
    right: 0;
    z-index: 80; /* Higher than other elements to ensure visibility */
    width: 70%;
    max-width: 800px;
    margin: 0 auto;
    margin-top: 10px; /* Add space between the count and the feedback */
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    animation: fadeInDown 0.3s ease-out;
  }

  /* Position the feedback message inside the final-count-display */
  .final-count-display #training-feedback {
    margin-top: 10px;
    position: relative;
    display: block !important;
  }

  /* Mobile adjustments for feedback in reverse mode */
  @media (max-width: 768px) {
    .training-arena-container.reverse-mode #training-feedback {
      width: 90%;
      font-size: 1.1rem;
      margin-top: 8px;
    }
  }

  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Special styling for feedback messages in reverse mode - no border for error messages */
  .training-arena-container.reverse-mode #training-feedback.error {
    background: transparent;
    color: var(--error-color);
    border: none;
    box-shadow: none;
    font-weight: 600;
  }

  /* Sequence Mode Bottom Controls - Mobile Optimization */
  .sequence-mode-bottom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .sequence-mode-bottom-controls .sequence-input {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0;
    background: none;
    border-top: none;
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
  }

  .sequence-mode-bottom-controls .sequence-table-controls {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0;
    background: none;
    border-top: none;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  /* Ensure sequence-container has enough bottom padding */
  .sequence-mode {
    padding-bottom: 150px;
  }

  /* Mobile adjustments for sequence mode */
  @media (max-width: 768px) {
    .sequence-mode-bottom-controls {
      padding: 0.5rem;
      gap: 0.5rem;
    }

    .sequence-mode-bottom-controls .sequence-input,
    .sequence-mode-bottom-controls .sequence-table-controls {
      gap: 0.5rem;
    }

    .sequence-mode-bottom-controls .sequence-table-controls .table-btn {
      padding: 0.5rem 0.75rem;
      font-size: 0.85rem;
    }

    .sequence-mode-bottom-controls .input-button-group {
      flex-direction: row;
      width: 100%;
      justify-content: center;
      gap: 0.5rem;
    }

    .sequence-mode-bottom-controls .input-button-group input {
      width: 60%;
      margin-bottom: 0;
    }

    .sequence-mode-bottom-controls .input-button-group button {
      width: 40%;
    }

    #cards-sequence {
      margin-bottom: 1rem;
      margin-top: 1rem;
      padding-bottom: 1rem;
    }

    .final-count-display {
      padding: 0.75rem;
    }

    #sequence-feedback {
      margin-top: 10px;
      position: relative;
      display: block !important;
      font-size: 1.1rem;
      text-align: center;
    }

    #sequence-feedback.error {
      background: transparent;
      color: var(--error-color);
      border: none;
      box-shadow: none;
      font-weight: 600;
    }

    #sequence-feedback.success {
      background: transparent;
      color: var(--success-color);
      border: none;
      box-shadow: none;
      font-weight: 600;
    }
  }

  /* Improve card pagination controls on mobile */
  @media (max-width: 576px) {
    .pagination-controls {
      flex-direction: column;
      gap: 0.5rem;
      margin-top: 1rem;
      align-items: center;
    }

    .pagination-btn {
      font-size: 0.9rem;
      padding: 0.5rem 0.75rem;
      width: 100%;
      max-width: 250px;
    }

    .page-indicator {
      font-size: 0.9rem;
      margin: 0.5rem 0;
    }
  }

  /* Improve mobile optimization for all training modes */
  @media (max-width: 768px) {
    /* General mobile optimizations for training area */
    .training-arena-container {
      border-radius: 8px;
      margin: 0 -10px;
    }
    
    .arena-header {
      padding: 1rem;
    }
    
    .arena-stats {
      gap: 0.75rem;
    }
    
    .stat {
      min-width: auto;
      padding: 0.5rem;
    }
    
    .stat-label {
      font-size: 0.7rem;
    }
    
    .stat-value {
      font-size: 1rem;
    }
    
    .card-area {
      padding: 1rem;
    }
    
    .playing-card {
      margin: 0 auto;
    }
    
    /* Flashcard mode optimizations */
    .flashcard-controls {
      padding: 1rem;
    }
    
    .value-buttons {
      gap: 0.5rem;
      margin-bottom: 1rem;
    }
    
    .value-btn {
      min-width: 4rem;
      height: 3rem;
      font-size: 1.1rem;
      padding: 0.5rem;
      border-radius: 6px;
    }
    
    #next-card-btn {
      width: 100%;
      max-width: 250px;
      margin: 0 auto;
      padding: 0.75rem;
    }
    
    /* Auto mode optimizations */
    .auto-container {
      padding: 1rem;
    }
    
    .speed-controls {
      gap: 1rem;
      margin-top: 1rem;
    }
    
    #current-speed {
      font-size: 0.9rem;
      min-width: 3rem;
      text-align: center;
    }
  }

  /* Extreme optimization for very small screens */
  @media (max-width: 576px) {
    .arena-stats {
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.5rem;
    }
    
    .stat {
      min-width: calc(50% - 0.5rem);
      font-size: 0.8rem;
      padding: 0.4rem;
    }
    
    .value-buttons {
      flex-direction: row;
      justify-content: center;
      width: 100%;
    }
    
    .value-btn {
      flex: 1;
      min-width: 3.5rem;
      padding: 0.5rem 0;
    }
    
    .playing-card {
      transform: scale(0.9);
    }
    
    #next-card-btn {
      font-size: 0.9rem;
    }
  }

  /* Auto Mode Bottom Controls */
  .auto-mode-bottom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    background: linear-gradient(to top, var(--secondary-color) 0%, rgba(26, 33, 56, 0.95) 100%);
    padding: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .auto-mode-bottom-controls .speed-controls {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0;
    background: none;
    border-top: none;
    width: 100%;
    max-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }

  .auto-mode-bottom-controls .auto-table-controls {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: auto;
    padding: 0;
    background: none;
    border-top: none;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  /* Ensure auto-container has enough bottom padding */
  .auto-container {
    padding-bottom: 150px;
    position: relative;
    text-align: center;
    padding-top: 10px;
  }

  /* Mobile adjustments for auto mode */
  @media (max-width: 768px) {
    .auto-mode-bottom-controls {
      padding: 0.5rem;
      gap: 0.5rem;
    }

    .auto-mode-bottom-controls .speed-controls {
      gap: 1rem;
    }

    .auto-mode-bottom-controls .auto-table-controls {
      gap: 0.5rem;
    }

    .auto-mode-bottom-controls .auto-table-controls .table-btn {
      padding: 0.5rem 0.75rem;
      font-size: 0.85rem;
    }

    #current-speed {
      font-size: 0.95rem;
      font-weight: 600;
      min-width: 3.5rem;
      text-align: center;
    }
    
    /* Adjust buttons in speed controls */
    .auto-mode-bottom-controls .speed-controls .btn-icon {
      width: 36px;
      height: 36px;
    }
  }

  /* Enhanced mobile layout for training results */
  @media (max-width: 768px) {
    .training-results {
      padding: 1.5rem;
    }
    
    .training-results h2 {
      font-size: 1.5rem;
      margin-bottom: 1rem;
    }
    
    .results-summary {
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
    }
    
    .result-stat {
      padding: 0.75rem;
    }
    
    .result-icon {
      width: 40px;
      height: 40px;
      font-size: 1rem;
      margin-bottom: 0.75rem;
    }
    
    .result-value {
      font-size: 1.5rem;
      margin-bottom: 0.25rem;
    }
    
    .result-label {
      font-size: 0.8rem;
    }
    
    .errors-section h3 {
      font-size: 1.25rem;
      margin: 1.5rem 0 1rem;
    }
    
    .error-list {
      max-height: 300px;
    }
    
    .error-item {
      padding: 0.75rem;
      margin-bottom: 0.75rem;
    }
    
    .error-message {
      font-size: 0.85rem;
    }
    
    .results-actions {
      flex-direction: column;
      gap: 0.75rem;
    }
    
    .results-actions button {
      width: 100%;
    }
  }

  @media (max-width: 576px) {
    .training-results {
      padding: 1rem;
      margin: 0 -10px;
    }
    
    .results-summary {
      grid-template-columns: 1fr;
    }
  }

  .btn-decision {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .btn-decision:hover:not(:disabled) {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  }

  .btn-decision:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    transform: none;
  }
  /* ===== MOBILE RESPONSIVE STYLES for DECISION TRAINING ===== */
  @media (max-width: 768px) {
    .decision-controls {
        gap: 0.75rem;
    }

    .btn-decision {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .hand-display .cards-container {
        gap: -50px; /* Overlap cards more on smaller screens */
    }

    .playing-card.small {
        width: 100px;
        height: 140px;
        font-size: 0.9rem;
    }
  }

  @media (max-width: 576px) {
    #training-screen .game-area {
        padding: 1.5rem 1rem;
    }

    .hand-display {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .player-hand, .dealer-hand {
        width: 100%;
    }

    .decision-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .btn-decision {
        width: 100%;
        font-size: 1rem;
        padding: 0.8rem;
    }

    .btn-decision[data-decision="surrender"] {
        grid-column: 1 / -1; /* Make surrender button full width */
    }
    
    .playing-card.small {
        width: 110px;
        height: 155px;
    }
  }

  /* ===== PREMIUM DECISION TRAINING STYLES ===== */

  .decision-training-container .training-arena-container {
    background: linear-gradient(160deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  }

  .decision-training-container .arena-header {
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  }

  .decision-training-container .stat-value {
    color: var(--accent-light);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
  }

  .decision-training-container .playing-card.small {
    background: linear-gradient(135deg, #f9f9f9 0%, #e6e6e6 100%);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3), inset 0 0 0 1px hsla(0,0%,100%,.8);
    border: 1px solid #ddd;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .hand-display .cards-container {
    perspective: 1000px;
  }

  .hand-display .playing-card.small {
    animation: cardAppear 0.5s ease-out forwards;
  }

  .hand-display .player-hand .playing-card:nth-child(2) {
    animation-delay: 0.15s;
  }

  .decision-training-container .btn-decision {
    background: rgba(26, 33, 56, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--accent-light);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-transform: none;
    letter-spacing: 0.5px;
  }

  .decision-training-container .btn-decision i {
    margin-right: 0.75rem;
    color: var(--accent-color);
    transition: transform 0.2s ease-in-out;
  }

  .decision-training-container .btn-decision:hover:not(:disabled) i {
    transform: scale(1.2);
  }

  .decision-training-container .btn-decision:disabled {
    background: rgba(26, 33, 56, 0.5);
    border-color: rgba(212, 175, 55, 0.2);
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
  }

  .decision-training-container .btn-decision:disabled i {
    color: rgba(212, 175, 55, 0.3);
  }

  #feedback-area.success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid var(--success-color);
    color: #a7f0ba;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
    text-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
  }

  #feedback-area.error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid var(--error-color);
    color: #f5b7bd;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.3);
    text-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
  }

  #feedback-area.visible {
    animation: feedback-pop 0.4s ease-out;
  }

  @keyframes feedback-pop {
    0% { transform: scale(0.8); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

  #challenge-results-area.feedback-message {
    background: var(--secondary-color);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  }

  /* Stile per l'indicatore "Live" */
  .live-indicator {
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle; /* Allinea il punto verticalmente con il testo */
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
  }

  @keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
  }