/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    color: white;
    height: 100vh;
    overflow: visible;
    line-height: 1.4;
}

.container {
    max-width: 100vw;
    height: 100vh;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Header Compatto */
.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 2em;
    margin: 0;
    padding: 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Setup Compatto */
.game-setup {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1000px;
    margin: 0 auto;
}

.game-setup h2 {
    text-align: center;
    color: #4CAF50;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.setup-section h3 {
    color: #FFD700;
    font-size: 1.3em;
    margin-bottom: 15px;
    text-align: center;
}

/* Team Setup */
.team-setup {
    display: flex;
    align-items: center;
    gap: 20px;
}

.team-setup-item {
    flex: 1;
    text-align: center;
}

.team-setup-item label {
    display: block;
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 8px;
}

.vs-separator {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.team-dropdown, .formation-dropdown {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 2px solid #4CAF50;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.team-dropdown:focus, .formation-dropdown:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.team-dropdown option, .formation-dropdown option {
    background: #1e3c72;
    color: white;
}

.controller-choice {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.controller-choice input[type="radio"] {
    margin-right: 3px;
}

.controller-choice label {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 1.1em;
    margin-bottom: 0;
}

.controller-choice label:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Formation Setup */
.formation-setup {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.formation-item {
    text-align: center;
}

.formation-item label {
    display: block;
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Start Button */
.start-button {
    display: block;
    margin: 0 auto;
    padding: 12px 30px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.start-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.start-button:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Game Board Layout Compatto */
.game-board {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Scoreboard Compatto */
.scoreboard-compact {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.score-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.score-display {
    font-size: 1.8em;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.game-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.time-display {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.turn-display {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.turn-label {
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

.turn-info {
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================
   NUOVO SISTEMA TOOLTIP COMPLETO
   ======================================== */

/* Tooltip Container - Base per tutti i tooltip */
.custom-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

/* Trigger Element - L'elemento che attiva il tooltip */
.custom-tooltip .tooltip-trigger {
    border-bottom: 1px dotted #ffd700;
    transition: all 0.2s ease;
}

.custom-tooltip:hover .tooltip-trigger {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* Tooltip Content - Il contenuto principale del tooltip */
.custom-tooltip .tooltip-content {
    /* Nascosto di default */
    visibility: hidden;
    opacity: 0;
    
    /* Posizionamento assoluto normale */
    position: absolute;
    z-index: 1000;
    
    /* Posizionamento standard sopra l'elemento */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    
    /* Stile visivo */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    min-width: 180px;
    max-width: 280px;
    line-height: 1.4;
    border: 2px solid #ffd700;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Transizioni fluide */
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Tipografia */
    white-space: pre-line;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    
    /* Previene interazioni */
    pointer-events: none;
    
    /* Evita overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Freccia del tooltip - Sotto il tooltip (punta verso l'alto) */
.custom-tooltip .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%; /* Posiziona la freccia sotto il tooltip */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #ffd700 transparent transparent transparent;
    z-index: 2147483648;
}

/* Freccia interna per effetto bordo */
.custom-tooltip .tooltip-content::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 6px;
    border-color: #1a1a2e transparent transparent transparent;
    z-index: 2147483649;
    margin-top: -1px;
}

/* Stato hover - Mostra il tooltip */
.custom-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Tooltip per valori POSITIVI (verdi) */
.custom-tooltip.positive .tooltip-content {
    background: linear-gradient(135deg, #2d5a3d 0%, #3d7c4a 50%, #4a9960 100%);
    border-color: #00ff7f;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 255, 127, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.custom-tooltip.positive .tooltip-content::after {
    border-color: #00ff7f transparent transparent transparent;
}

.custom-tooltip.positive .tooltip-content::before {
    border-color: #2d5a3d transparent transparent transparent;
}

/* Tooltip per valori NEGATIVI (rossi) */
.custom-tooltip.negative .tooltip-content {
    background: linear-gradient(135deg, #5a2d2d 0%, #7c3d3d 50%, #994a4a 100%);
    border-color: #ff6b6b;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 107, 107, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.custom-tooltip.negative .tooltip-content::after {
    border-color: #ff6b6b transparent transparent transparent;
}

.custom-tooltip.negative .tooltip-content::before {
    border-color: #5a2d2d transparent transparent transparent;
}

/* Tooltip direzionali - Sopra l'elemento */
.custom-tooltip.tooltip-top .tooltip-content::after {
    top: 100%;
    border-width: 8px 8px 0 8px;
    border-color: #ffd700 transparent transparent transparent;
}

.custom-tooltip.tooltip-top .tooltip-content::before {
    top: 100%;
    border-width: 6px 6px 0 6px;
    border-color: #1a1a2e transparent transparent transparent;
    margin-top: -1px;
}

/* Tooltip direzionali - Sotto l'elemento */
.custom-tooltip.tooltip-bottom .tooltip-content::after {
    bottom: 100%;
    top: auto;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #ffd700 transparent;
}

.custom-tooltip.tooltip-bottom .tooltip-content::before {
    bottom: 100%;
    top: auto;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent #1a1a2e transparent;
    margin-top: 0;
    margin-bottom: -1px;
}

/* Tooltip direzionali - A sinistra dell'elemento */
.custom-tooltip.tooltip-left .tooltip-content::after {
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #ffd700;
}

.custom-tooltip.tooltip-left .tooltip-content::before {
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #1a1a2e;
    margin-left: -1px;
    margin-top: 0;
}

/* Tooltip direzionali - A destra dell'elemento */
.custom-tooltip.tooltip-right .tooltip-content::after {
    top: 50%;
    right: 100%;
    left: auto;
    transform: translateY(-50%);
    border-width: 8px 8px 8px 0;
    border-color: transparent #ffd700 transparent transparent;
}

.custom-tooltip.tooltip-right .tooltip-content::before {
    top: 50%;
    right: 100%;
    left: auto;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent #1a1a2e transparent transparent;
    margin-right: -1px;
    margin-top: 0;
}

/* Animazione di entrata */
@keyframes tooltipFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-tooltip:hover .tooltip-content {
    animation: tooltipFadeIn 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Stili per tooltip neutrali (valore 0) */
.custom-tooltip.neutral .tooltip-content {
    border-color: #a0aec0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(160, 174, 192, 0.2);
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    z-index: 999999;
}

.custom-tooltip.neutral .tooltip-content::after {
    border-color: #a0aec0 transparent transparent transparent;
    z-index: 999999;
}

.custom-tooltip.neutral .tooltip-content::before {
    border-color: #4a5568 transparent transparent transparent;
    z-index: 1000000;
}

/* Stili per i tooltip delle tattiche e bonus situazionali */
.tactic-btn[title],
.situational-bonus-tooltip[title] {
    position: relative;
    cursor: help;
}

.tactic-btn[title]:hover::after,
.situational-bonus-tooltip[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-line;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid #718096;
    max-width: 300px;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    pointer-events: none;
}

.tactic-btn[title]:hover::before,
.situational-bonus-tooltip[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #4a5568;
    z-index: 999;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    pointer-events: none;
}

/* Stili specifici per tooltips bonus situazionali */
.situational-bonus-tooltip[title]:hover::after {
    background: linear-gradient(135deg, #2b6cb8 0%, #3182ce 100%);
    border-color: #4299e1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

.situational-bonus-tooltip[title]:hover::before {
    border-top-color: #3182ce;
}

/* Animazione fade-in per tooltips */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Miglioramento posizionamento per celle tabella */
.confronto-table td.situational-bonus-tooltip {
    position: relative;
}

.confronto-table td.situational-bonus-tooltip:hover {
    background-color: rgba(66, 153, 225, 0.1);
}

/* Tooltips per celle con valori positivi/negativi */
.situational-bonus-tooltip.positive-value[title]:hover::after {
    background: linear-gradient(135deg, #2f855a 0%, #38a169 100%);
    border-color: #48bb78;
}

.situational-bonus-tooltip.positive-value[title]:hover::before {
    border-top-color: #38a169;
}

.situational-bonus-tooltip.negative-value[title]:hover::after {
    background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    border-color: #fc8181;
}

.situational-bonus-tooltip.negative-value[title]:hover::before {
    border-top-color: #e53e3e;
}

/* Tabella Confronto Dettagliata */
.confronto-table-section {
    margin-top: 8px;
    padding: 6px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

.confronto-table-section h4 {
    margin-bottom: 4px;
    color: #2c3e50;
    text-align: center;
    font-size: 11px;
    line-height: 1.1;
}

.confronto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    background: white;
    border-radius: 6px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.confronto-table th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3px 2px;
    text-align: center;
    font-weight: bold;
    font-size: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.1;
}

.confronto-table th:last-child {
    border-right: none;
}

.confronto-table td {
    padding: 3px 2px;
    text-align: center;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    color: #2c3e50;
    background: white;
    font-size: 9px;
    line-height: 1.1;
}

.confronto-table td:last-child {
    border-right: none;
}

.confronto-table .team-row {
    background: #f8f9fa;
}

.confronto-table .team-row td {
    color: #2c3e50;
    background: #f8f9fa;
}

.confronto-table .team-row.winner {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    font-weight: bold;
}

.confronto-table .team-row.winner td {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    font-weight: bold;
}

.confronto-table .team-name {
    font-weight: bold;
    color: #2c3e50;
    text-align: left;
    padding-left: 8px;
}

.confronto-table .positive-value {
    color: #28a745 !important;
    font-weight: bold;
}

.confronto-table .negative-value {
    color: #dc3545 !important;
    font-weight: bold;
}

.confronto-table .neutral-value {
    color: #6c757d !important;
}

/* Nuove classi per le colonne della tabella migliorata */
.confronto-table .partial-percent {
    background: #f0f8ff;
    color: #1e90ff;
    font-weight: bold;
}

.confronto-table .efficacy-percent {
    background: #f0fff0;
    color: #228b22;
    font-weight: bold;
}

.confronto-table .efficacy-ovr {
    background: #fff8dc;
    color: #b8860b;
    font-weight: bold;
}

.confronto-phase-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Stili specifici per la tabella portiere */
.goalkeeper-table .result-cell {
    font-weight: bold;
    text-align: center;
}

.goalkeeper-table .goal-result {
    background: #d4edda !important;
    color: #155724 !important;
}

.goalkeeper-table .save-result {
    background: #cce5ff !important;
    color: #004085 !important;
}

/* Stili per i giocatori con statistiche */
.player-item {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.2;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    overflow: hidden;
    min-height: 0;
    height: auto;
}

.player-name {
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    font-size: 11px;
    line-height: 1.2;
    word-wrap: break-word;
}

.player-stats {
    font-size: 11px;
    color: #e0e0e0;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    display: none; /* Non più necessario */
}

.dept-players {
    max-height: none;
    overflow: hidden;
    padding-right: 2px;
}

/* Layout Principale Ottimizzato - No Scroll */
.compact-layout {
    display: grid;
    grid-template-columns: 1fr 420px 320px;
    gap: 15px;
    flex: 1;
    overflow: visible;
    min-height: 0;
    height: calc(100vh - 80px);
}

/* Colonna Squadre - No Scroll */
.teams-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    min-width: 500px;
}

/* Container per le squadre side by side */
.teams-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.team-compact {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.team-compact h4 {
    text-align: center;
    margin-bottom: 8px;
    color: #FFD700;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.departments-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.dept-line {
    display: grid;
    grid-template-columns: 20px 1fr 50px;
    gap: 6px;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 3px;
    flex-shrink: 0;
}

.dept-icon {
    font-size: 14px;
    text-align: center;
}

.dept-players {
    font-size: 11px;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.fitness-mini {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.fitness-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: var(--fitness-width, 100%);
    transition: all 0.3s ease;
}

.fitness-mini.high::before {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

.fitness-mini.medium::before {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.fitness-mini.low::before {
    background: linear-gradient(90deg, #F44336, #FF5722);
    animation: fitnessWarning 1s ease-in-out infinite alternate;
}

@keyframes fitnessWarning {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

/* Colonna Tattiche - No Scroll */
.tactics-column-narrow {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: visible;
    height: 100%;
}

.tactics-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.tactics-section h4 {
    text-align: center;
    margin-bottom: 4px;
    color: #FFD700;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    line-height: 1.1;
}

.tactics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    flex: 1;
    align-content: start;
    overflow: visible;
}

.tactic-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 4px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    text-align: center;
    overflow: visible;
    backdrop-filter: blur(5px);
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    font-weight: 500;
    min-height: 0;
    height: auto;
}

.tactic-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.tactic-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.tactic-btn.highlighted {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    animation: highlightPulse 2s ease-in-out infinite;
}

.tactic-btn.selected {
    background: rgba(76, 175, 80, 0.4);
    border-color: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    animation: selectedPulse 2s ease-in-out infinite;
}

.tactic-btn.defensive.selected {
    background: rgba(255, 87, 34, 0.4);
    border-color: #FF5722;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
    animation: selectedPulse 2s ease-in-out infinite;
}

.eff {
    display: block;
    color: #FFD700;
    font-size: 0.8em;
    margin-top: 2px;
}

/* Game Controls */
.game-controls {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.selected-display {
    display: flex;
    justify-content: space-around;
    margin-bottom: 6px;
    font-size: 0.8em;
    font-weight: bold;
}

.selected-display span {
    color: #FFD700;
}

.turn-info {
    font-size: 0.7em;
    opacity: 0.8;
}

.execute-btn {
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(45deg, #FF5722, #E64A19);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 87, 34, 0.3);
}

.execute-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.5);
}

.execute-btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Colonna Info */
.info-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Sezione Log rimossa confronto-section */

.confronto-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0;
    font-size: 0.8em;
}

.confronto-winner {
    color: #4CAF50;
    font-weight: bold;
}

.confronto-loser {
    color: #FF5722;
}

.confronto-stats {
    font-size: 0.7em;
    color: #BBB;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.log-section, .history-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.log-section h4, .history-section h4 {
    color: #FFD700;
    font-size: 1em;
    margin-bottom: 8px;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.log-mini {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.75em;
    line-height: 1.4;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.log-mini p {
    margin-bottom: 3px;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.history-mini {
    font-size: 0.8em;
}

.team-hist {
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.team-hist strong {
    color: #4CAF50;
}

.back-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Scrollbar personalizzato */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive per schermi più piccoli */
@media (max-width: 1200px) {
    .compact-layout {
        grid-template-columns: 250px 1fr 200px;
    }
    
    .tactic-btn {
        font-size: 0.65em;
        padding: 6px;
    }
}

@media (max-width: 1000px) {
    .compact-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .teams-column {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .team-compact {
        min-width: 200px;
    }
}

/* Stili specifici per la tabella portiere nella colonna di destra */
.goalkeeper-summary {
    margin-top: 15px !important;
    max-width: 100%;
    padding: 6px !important;
}

.goalkeeper-summary h4 {
    font-size: 12px !important;
    margin-bottom: 6px !important;
}

.goalkeeper-summary .confronto-table {
    font-size: 10px !important;
}

.goalkeeper-summary .confronto-table th {
    padding: 3px 2px !important;
    font-size: 9px !important;
}

.goalkeeper-summary .confronto-table td {
    padding: 3px 2px !important;
    font-size: 9px !important;
}

.goalkeeper-summary .confronto-table-container {
    max-height: 180px;
    overflow-y: auto;
}

/* Mantieni placeholder delle tabelle principali a dimensioni normali */
.confronto-placeholder {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stili per le righe placeholder nelle tabelle */
.placeholder-row td {
    color: rgba(255, 255, 255, 0.4) !important;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02) !important;
}

.placeholder-row .team-name {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Animazioni sottili */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes highlightPulse {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
        border-color: #FFD700;
    }
    50% { 
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
        border-color: #FFA500;
    }
}

@keyframes selectedPulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    }
    50% { 
        box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
    }
}

@keyframes particleFloat {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -150%) scale(1.5);
    }
}

.game-board {
    animation: fadeIn 0.5s ease-out;
}

.tactic-btn {
    animation: fadeIn 0.3s ease-out;
}

.team-compact {
    animation: fadeIn 0.4s ease-out;
}
