body { font-family: 'Lora', serif; background: #e8d8b7; color: #3e2723; margin: 0; padding: 0; }
h1, h2, h3, button, #ad-banner { font-family: 'Cinzel', serif; margin: 5px 0; }

.f1-text-color { color: #1565C0; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); } 
.f2-text-color { color: #C62828; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); } 

#ad-banner { background: #8b0000; color: #ffd700; padding: 8px; font-weight: bold; text-align: center; letter-spacing: 2px; }

/* --- NEW HEADER ALIGNMENT --- */
.header-container { 
    background: #d2b48c; 
    border-bottom: 3px solid #8b4513; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); 
    width: 100%;
}
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    max-width: 1300px; /* Matches Arena width exactly */
    margin: 0 auto; 
    padding: 15px 10px; 
}
.title-area h1 { margin: 0; font-size: 2.2em; color: #5c4033; }
.subtitle { font-style: italic; color: #8b0000; font-size: 1.1em; font-weight: bold; margin-top: 5px; }
.status-area { text-align: right; font-weight: bold; font-size: 1.2em; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

/* --- ARENA --- */
.arena { display: flex; max-width: 1300px; margin: 20px auto; gap: 15px; padding: 0 10px; height: 75vh; }
.fighter-card { flex: 1; background: #f4ecd8; border: 2px solid #8b4513; border-radius: 8px; padding: 15px; text-align: center; box-shadow: inset 0 0 20px rgba(139,69,19,0.2); overflow-y: auto; }
.center-column { flex: 1.5; display: flex; flex-direction: column; gap: 15px; }

.svg-container { height: 180px; display: flex; align-items: center; justify-content: center; margin: 10px 0; }
.svg-container svg { max-height: 100%; max-width: 100%; }
.flip svg { transform: scaleX(-1); }

.hp-bar { width: 100%; height: 15px; background: #555; border: 1px solid #333; margin-bottom: 5px; }
.hp-fill { height: 100%; background: #8b0000; transition: width 0.3s; }

/* --- LOGS --- */
.combat-log { flex: 1; background: #fff8e7; border: 2px solid #8b4513; padding: 15px; overflow-y: auto; font-size: 1.1em; border-radius: 8px; box-shadow: inset 0 0 10px rgba(0,0,0,0.1); }
.combat-log p { margin: 10px 0; padding: 5px; line-height: 1.4; border-bottom: 1px solid rgba(0,0,0,0.05); }

.herald-log-entry { background: #4b0082; color: #ffffff !important; border-left: 5px solid #ffd700; font-weight: bold; padding: 10px !important; margin: 15px 0 !important; }
.sponsor-log-entry { background: #004d40; color: #e0f2f1 !important; border-left: 5px solid #1de9b6; font-style: italic; font-weight: bold; padding: 10px !important; margin: 15px 0 !important; }
.cabbage-log-entry { background: #e8f5e9; color: #1b5e20 !important; border-left: 5px solid #4caf50; padding: 10px !important; font-weight:bold; }
.heal-log-entry { background: #f3e5f5; color: #4a148c !important; border-left: 5px solid #9c27b0; padding: 10px !important; font-weight:bold; }
.climax-log-entry { background: #8b0000; color: #ffd700 !important; text-align: center; font-size: 1.2em; font-weight: bold; padding: 15px !important; text-shadow: 1px 1px black; }

/* --- BUTTONS & PANELS --- */
.interact-panel { display: flex; gap: 5px; margin: 10px 0; }
.btn-cabbage { background: #81c784; color: black; border: 1px solid #388e3c; font-size: 0.85em; padding: 8px; flex: 1; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-cabbage:hover { background: #66bb6a; }
.btn-heal { background: #ce93d8; color: black; border: 1px solid #8e24aa; font-size: 0.85em; padding: 8px; flex: 1; border-radius: 4px; cursor: pointer; font-weight: bold;}
.btn-heal:hover { background: #ab47bc; }

.bet-panel { background: #e8d8b7; border: 1px solid #b08d57; margin-top: 10px; padding: 10px; border-radius: 5px; }
.pool-text { font-size: 0.9em; margin-bottom: 5px; font-weight: bold; }

.prop-bets { background: #d2b48c; border: 2px solid #8b4513; padding: 10px; border-radius: 8px; text-align: center; }
.prop-grid { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }

button { background: #8b4513; color: #f4ecd8; border: 2px solid #5c4033; padding: 8px 12px; cursor: pointer; border-radius: 4px; font-weight: bold; transition: background 0.2s; }
button:hover { background: #5c4033; color: #ffd700; }
button:active { transform: scale(0.95); }

/* --- BOTTOM SECTION & LEADERBOARD --- */
.bottom-section { display: flex; max-width: 1300px; margin: 20px auto; gap: 15px; padding: 0 10px; }
.controls { flex: 1; margin: 0; padding: 20px; background: #d2b48c; border: 2px solid #8b4513; text-align: center; border-radius: 8px; }
select, input { padding: 8px; margin: 5px; font-family: inherit; font-size: 1em; border: 1px solid #8b4513; background: #fff8e7; }

.leaderboard { flex: 1; background: #d2b48c; border: 2px solid #8b4513; border-radius: 8px; padding: 15px; color: #3e2723; }
.leaderboard h3 { text-align: center; margin-top: 0; color: #8b0000; }
.lb-tabs { display: flex; justify-content: center; gap: 5px; margin-bottom: 10px; }
.lb-btn { background: #c19a6b; color: #3e2723; border: 2px solid #8b4513; padding: 5px 10px; font-size: 0.9em; cursor: pointer; }
.lb-btn.active { background: #8b0000; color: #ffd700; border-color: #5c4033; }
.lb-list { list-style-type: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; font-family: monospace; font-size: 1.1em; }
.lb-list li { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px dashed #8b4513; background: #fff8e7; margin-bottom: 2px; border-radius: 3px; }
.lb-list li:nth-child(1) { background: #ffd700; font-weight: bold; border: 2px solid #c5b358; }
.lb-list li:nth-child(2) { background: #e0e0e0; font-weight: bold; border: 1px solid #71797E; }
.lb-list li:nth-child(3) { background: #cd7f32; font-weight: bold; border: 1px solid #8b4513; }
.lb-name { color: #8b0000; font-weight: bold; }
.lb-score { color: #1b5e20; font-weight: bold; }

/* --- MERCY BOX --- */
.mercy-box { display: none; flex-direction: column; justify-content: center; background: #000; padding: 15px; border: 4px solid #8b0000; text-align: center; color: white; animation: pulse 1s infinite; }
@keyframes pulse { 0% { border-color: #8b0000; } 50% { border-color: #ff0000; } 100% { border-color: #8b0000; } }
.mercy-buttons { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.btn-spare { background: #2e7d32; color: white; border: none; padding: 10px; font-weight: bold; width: 100%; }
.btn-kill { background: #c62828; color: white; border: none; padding: 10px; font-weight: bold; width: 100%; }

/* --- PERKS --- */
.perk-label { font-size: 0.8em; margin-bottom: 10px; font-family: sans-serif; }
.boon { color: #2e7d32; font-weight: bold; background: rgba(0,255,0,0.1); padding: 2px 5px; border-radius: 3px; }
.bane { color: #c62828; font-weight: bold; background: rgba(255,0,0,0.1); padding: 2px 5px; border-radius: 3px; }

/* --- ENTRY MODAL --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-content { background: #e8d8b7; border: 5px solid #8b0000; padding: 40px; max-width: 600px; text-align: center; border-radius: 10px; box-shadow: 0 0 30px rgba(139, 0, 0, 0.5); color: #3e2723; }
.modal-content p { font-size: 1.2em; line-height: 1.5; margin-bottom: 20px; }
.btn-enter { background: #8b0000; color: #ffd700; font-size: 1.5em; padding: 15px 30px; border: 3px solid #5c4033; border-radius: 5px; cursor: pointer; font-family: 'Cinzel', serif; transition: transform 0.2s, background 0.2s; }
.btn-enter:hover { background: #a50000; transform: scale(1.05); }

#mute-btn { background: #5c4033; color: #ffd700; border: 2px solid #8b4513; margin-top: 10px; padding: 5px 10px; font-size: 0.8em; border-radius: 5px; cursor: pointer; box-shadow: 2px 2px 5px rgba(0,0,0,0.5); }
#mute-btn:hover { background: #8b0000; }
.muted { opacity: 0.6; text-decoration: line-through; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .header { flex-direction: column; text-align: center; gap: 15px; }
    .status-area { align-items: center; }
    .arena { flex-direction: column; height: auto; }
    .fighter-card { width: 95%; margin: 10px auto; order: 1; }
    .center-column { order: 2; height: 350px; width: 95%; margin: 10px auto; }
    .bottom-section { flex-direction: column; }
}

/* Un-flips the battle shout text on Fighter 2 */
.flip svg text {
    transform: scaleX(-1);
}

/* Styles the "None" perk to be less prominent */
.perk-none {
    color: #777;
    font-style: italic;
}

/* Makes critical hit text stand out in the log */
.crit-hit {
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.15em;
    text-transform: uppercase;
    text-shadow: 1px 1px #ffd700;
}

.veteran-tag {
    font-size: 0.65em; 
    color: #8b0000; 
    text-shadow: 1px 1px 0px #ffd700;
    font-weight: bold;
    display: block;
    margin-top: 2px;
}

/* Fixes the backward text issue for Fighter 2 shouts */
.flip svg text {
    transform: scaleX(-1);
    transform-origin: center;
}

.perk-none {
    color: #777;
    font-style: italic;
    font-size: 0.9em;
}

.crit-hit {
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.1em;
    text-transform: uppercase;
    text-shadow: 1px 1px #ffd700;
}