body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #1a1a1a;
    color: white;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: 60px 1fr 1fr 100px;
    grid-template-columns: 300px 1fr;
    grid-template-areas: 
        "header header"
        "sidebar cpu"
        "sidebar player"
        "sidebar footer";
}

header { 
    grid-area: header; 
    background: #111; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-bottom: 2px solid #333;
}

.sidebar {
    grid-area: sidebar;
    background: #151515;
    border-right: 2px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cpu-side { 
    grid-area: cpu; 
    background: #201010; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    border-bottom: 1px dashed #444;
    position: relative;
}

.player-side { 
    grid-area: player; 
    background: #101520; 
    display: flex; 
    flex-direction: column;
    justify-content: space-around; 
    align-items: center;
    position: relative;
    padding: 20px;
}

.hand-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.card-hand {
    width: 100px;
    height: 140px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #555;
    background: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.card-hand:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(26,115,232,0.4);
    border-color: #1a73e8;
}

.card-hand.selected {
    border-color: #ffeb3b;
    box-shadow: 0 0 15px #ffeb3b;
}

.cpu-hand {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.card-mini.cpu {
    background: #d93025;
}

.main-action-btn {
    padding: 10px 30px;
    font-size: 1rem;
    background: #555;
    cursor: not-allowed;
}

.main-action-btn.active {
    background: #1a73e8;
    cursor: pointer;
}

.footer-info {
    grid-area: footer;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px;
}

.side-label {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
}

.card-area {
    display: flex;
    gap: 40px;
    align-items: center;
}

.card-slot {
    width: 120px;
    height: 170px;
    border: 2px solid #444;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    background: #fff;
    color: #000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transition: all 0.2s;
}

.card-deck {
    background: #d93025;
    color: white;
    border: 3px solid #fff;
    font-size: 1rem;
    cursor: default;
}

.card-deck.player { 
    background: #1a73e8; 
    width: 100px;
    height: 140px;
    border-radius: 8px;
    font-size: 2rem;
}

.war-pile {
    display: flex;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
    align-items: center;
}

.card-mini {
    width: 35px;
    height: 55px;
    background: #444;
    border: 1px solid #666;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.cpu-side .card-mini { background: #d93025; border-color: #ff9999; }
.player-side .card-mini { background: #1a73e8; border-color: #99ccff; }

/* Modalità Legacy e Mappa */
.setup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.map-container {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    gap: 15px;
    background: #222;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #444;
}

.region {
    width: 120px;
    height: 80px;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    text-align: center;
    padding: 5px;
}

.region.controlled { background: #1a73e8; border-color: #4facfe; }
.region.current { border: 2px solid #ffeb3b; box-shadow: 0 0 15px #ffeb3b; }
.region:hover:not(.controlled) { background: #444; }

.region-icon { font-size: 1.5rem; }

/* Evoluzione Carte */
.stickers-area {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 2px;
}

.sticker {
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 5px #ffeb3b;
}

.scars-area {
    position: absolute;
    bottom: 5px;
    left: 5px;
    display: flex;
    gap: 2px;
}

.scar {
    width: 10px;
    height: 2px;
    background: #ff5252;
    transform: rotate(-45deg);
}

.legacy-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #4facfe;
    color: #fff;
    font-size: 0.5rem;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.mode-selector {
    display: flex;
    gap: 20px;
}

.btn-mode {
    padding: 20px 40px;
    font-size: 1.2rem;
    min-width: 250px;
}

.btn-legacy {
    background: linear-gradient(135deg, #1a73e8 0%, #4facfe 100%);
}

.hidden { display: none !important; }

.status-box {
/* ... resto del file ... */
    color: #ffeb3b;
    font-weight: bold;
    font-size: 1.4rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.winner-badge {
    position: absolute;
    top: -20px;
    background: #ffeb3b;
    color: #000;
    padding: 5px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    animation: bounceIn 0.5s ease-out;
    z-index: 20;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.card-slot {
    position: relative;
    /* ... resto invariato ... */

.log-area {
    flex-grow: 1;
    background: #000;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #0f0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.log-msg {
    margin-bottom: 5px;
    border-bottom: 1px solid #111;
    padding-bottom: 2px;
}

.log-msg:first-child {
    color: #fff;
    font-weight: bold;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #1a73e8;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-hub {
    text-align: center;
    color: #aaa;
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 5px;
}

.btn-hub:hover { color: white; }

.count-badge {
    background: rgba(255,255,255,0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #222;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #1a73e8;
    box-shadow: 0 0 30px rgba(26,115,232,0.5);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffeb3b;
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.btn-modal {
    padding: 15px 30px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}