* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #222; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
header { text-align: center; margin-bottom: 30px; color: white; }
header h1 { font-size: 2.5rem; margin-bottom: 10px; text-shadow: 2px 2px 5px rgba(0,0,0,0.4); }
header p { font-size: 1.2rem; opacity: 0.9; text-shadow: 1px 1px 3px rgba(0,0,0,0.4); }
.game-area { background: rgba(255, 255, 255, 0.95); border-radius: 20px; padding: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); backdrop-filter: blur(10px); }
.objectives-section { margin-bottom: 30px; }
.objectives-section h2 { margin-bottom: 20px; font-size: 1.8rem; color: #4a5568; }
.objectives-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.objective-card { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); border-radius: 15px; padding: 15px; color: white; box-shadow: 0 8px 25px rgba(0,0,0,0.1); transition: all 0.3s ease; position: relative; min-height: 145px; display: flex; flex-direction: column; overflow: hidden; }
.objective-card-content { position: relative; z-index: 2; display: flex; flex-direction: column; flex-grow: 1; }
.objective-icon-background { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 75px; color: rgba(255, 255, 255, 0.1); z-index: 1; pointer-events: none; }
.objective-card.custom .objective-icon-background { color: rgba(0, 0, 0, 0.08); }
.objective-card.drag-over { box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), 0 15px 35px rgba(0,0,0,0.3); border: 2px dashed white; }
.objective-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.objective-card.fixed { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.objective-card.custom { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #222; }
.objective-card.custom h3, .objective-card.custom .type { text-shadow: 1px 1px 3px rgba(0,0,0,0.1); }
.objective-card h3 { font-size: 1.1rem; margin-bottom: 8px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.objective-card .type { font-size: 0.75rem; opacity: 0.8; margin-bottom: 8px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.energy-allocation { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.3); }
.energy-cards-here { min-height: 40px; border: 2px dashed rgba(255,255,255,0.5); border-radius: 10px; padding: 5px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; transition: all 0.3s ease; }
.energy-total-display { font-weight: bold; text-align: center; font-size: 1rem; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.players-section { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 30px; position: sticky; bottom: 10px; z-index: 100; padding: 10px; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(5px); border-radius: 20px; box-shadow: 0 -10px 30px rgba(0,0,0,0.2); }
.player-area { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 15px; padding: 20px; color: white; }
.player-area h3 { margin-bottom: 15px; font-size: 1.3rem; text-align: center; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); cursor: pointer; border-radius: 10px; padding: 5px; transition: background-color 0.3s; }
.player-area h3:focus { outline: none; background-color: rgba(255,255,255,0.2); }
.energy-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; min-height: 60px; padding: 10px; border: 2px dashed rgba(255,255,255,0.3); border-radius: 10px; justify-content: center; }
.energy-card { width: 45px; height: 65px; background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1rem; color: #222; cursor: grab; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.1); user-select: none; touch-action: none; }
.energy-card:hover { transform: scale(1.05) rotate(2deg); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.energy-card:active { cursor: grabbing; }

/* CORREÇÃO: Estilo da carta "fantasma" que se move com o dedo */
.energy-card.dragging {
    opacity: 1 !important;
    transform: scale(1.1) rotate(3deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* CORREÇÃO: Estilo da carta original, que fica invisível no lugar de origem */
.energy-card-source {
    opacity: 0 !important;
}

.energy-total { text-align: center; font-weight: bold; font-size: 1.1rem; padding: 10px; background: rgba(255,255,255,0.2); border-radius: 10px; }
.energy-bar-label { margin-bottom: 8px; font-size: 0.9rem; }
.energy-bar-container { width: 100%; height: 15px; background-color: rgba(0,0,0,0.2); border-radius: 10px; overflow: hidden; }
.energy-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #a8edea 0%, #fed6e3 100%); border-radius: 10px; transition: width 0.5s ease-in-out; }
.game-controls { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.game-controls button { padding: 15px 30px; border: none; border-radius: 25px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
#reset-game, #calculate-results, #add-event { color: #222; }
#reset-game { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
#calculate-results { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
#add-event { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.game-controls button:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.global-modifier { position: absolute; top: 5px; left: 5px; padding: 3px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: bold; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); animation: fadeIn 0.5s ease; z-index: 3; }
.global-modifier.bonus { background-color: #38A169; }
.global-modifier.malus { background-color: #E53E3E; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(5px); }
.modal-content { background: white; margin: 5% auto; padding: 30px; border-radius: 20px; width: 90%; max-width: 700px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); position: relative; animation: modalSlideIn 0.3s ease; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-50px); } to { opacity: 1; transform: translateY(0); } }
.close { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; position: absolute; right: 20px; top: 15px; }
.close:hover { color: #222; }
.modal h2 { margin-bottom: 10px; color: #4a5568; }
.modal p { margin-bottom: 20px; color: #718096; }
.modal-form { margin-top: 10px; display: flex; flex-direction: column; gap: 15px; }
.modal-form input { width: 100%; padding: 15px; font-size: 1.1rem; border: 1px solid #ddd; border-radius: 10px; outline: none; }
.modal-form button { padding: 15px; font-size: 1.1rem; font-weight: bold; border-radius: 10px; border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; cursor: pointer; transition: transform 0.2s ease; }
.modal-form button:hover { transform: scale(1.02); }
.modal-form button:disabled { background: #ccc; cursor: not-allowed; }
.result-details { font-size: 0.9em; color: #718096; }
.result-card-chips { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.result-card-chip { padding: 2px 6px; border-radius: 5px; font-weight: bold; color: white; font-size: 0.8em; }
.result-card-chip.p1 { background-color: #4299e1; }
.result-card-chip.p2 { background-color: #ed8936; }
#event-ok { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 12px 25px; border-radius: 25px; cursor: pointer; font-weight: bold; margin-top: 20px; transition: all 0.3s ease; }
#event-ok:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
@media (max-width: 768px) { .players-section { grid-template-columns: 1fr; position: static; } .objectives-grid { grid-template-columns: 1fr; } .game-controls { flex-direction: column; align-items: center; } .game-controls button { width: 100%; max-width: 300px; } header h1 { font-size: 2rem; } .container { padding: 10px; } .game-area { padding: 20px; } }
.objective-card { animation: cardSlideIn 0.5s ease; }
@keyframes cardSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.energy-card { animation: cardPop 0.3s ease; }
@keyframes cardPop { 0% { transform: scale(0); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } }