/* --- 1. CORE CONTAINER & TYPOGRAPHY --- */
.ecac-sim-container { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    color: #333; 
    max-width: 850px; 
    margin: 10px auto; 
    line-height: 1.3;
}

.ecac-sim-container.bracket-layout { 
    max-width: 100% !important; 
    padding: 0 5px;
}

/* --- 2. HEADER & BRANDING --- */
.sim-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 3px solid #5a2111; 
    margin-bottom: 15px; 
    padding-bottom: 8px;
}

.sim-header h2 {
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.2rem;
    color: #222;
}

/* --- 3. MICRO BUTTONS --- */
.info-btn, .bracket-btn { 
    background: #5a2111; 
    color: #fff; 
    border: 1px solid #331209; 
    padding: 5px 10px; 
    cursor: pointer; 
    font-weight: bold; 
    text-transform: uppercase;
    font-size: 0.6rem;
    box-shadow: 2px 2px 0 #333;
}

.bracket-btn {
    display: block;
    width: fit-content;
    margin: 0 auto 20px auto;
    padding: 8px 14px;
    font-size: 0.75rem;
}

.info-btn:hover, .bracket-btn:hover {
    background: #555555;
}

.reset-btn { 
    margin-top: 20px; 
    padding: 8px 16px; 
    background: #666; 
    color: #fff; 
    border: none; 
    text-transform: uppercase; 
    font-weight: bold; 
    cursor: pointer;
    font-size: 0.7rem;
}

/* --- 4. STANDINGS & SCENARIOS --- */
.standings-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; font-size: 0.8rem; }
.standings-table th { background: #222; color: #fff; padding: 6px; text-transform: uppercase; font-size: 0.65rem; }
.standings-table td { padding: 6px; border-bottom: 1px solid #eee; }

.top-four { background-color: #f0fdf4; border-left: 3px solid #22c55e; }
.home-ice { background-color: #eff6ff; border-left: 3px solid #3b82f6; }

.target-team-row td {
    border-top: 2px solid #5a2111 !important;
    border-bottom: 2px solid #5a2111 !important;
}
.target-team-row td:first-child { border-left: 2px solid #5a2111 !important; }
.target-team-row td:last-child { border-right: 2px solid #5a2111 !important; }

.scenario-panel { background: #fdf2f2; padding: 10px; border-left: 3px solid #5a2111; margin-bottom: 15px; font-size: 0.75rem; }
.clinch-output { margin-top: 8px; font-weight: 800; color: #5a2111; font-size: 0.95rem; text-transform: uppercase; }

/* --- 5. GAME CARDS --- */
.game-card { border: 1px solid #ddd; padding: 10px; margin-bottom: 6px; }
.teams-row { font-weight: 800; font-size: 0.85rem; margin-bottom: 6px; display: flex; justify-content: space-between; }
.button-group button { flex: 1; padding: 5px; font-size: 0.6rem; font-weight: bold; text-transform: uppercase; border: 1px solid #ccc; }
.button-group button.active { background: #5a2111; color: white; }

/* --- 6. RESPONSIVE BRACKET ENGINE --- */
.bracket-instructions {
    background: #f4f4f4;
    border-left: 4px solid #555555;
    padding: 8px 12px;
    margin-bottom: 15px;
    font-size: 0.8rem;
}

.bracket-scroll { 
    display: flex; 
    gap: 8px; 
    overflow-x: auto; 
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch; /* Smooth swiping on iPhones */
}

/* DESKTOP VIEW (Screens wider than 768px) */
@media (min-width: 769px) {
    .bracket-col { 
        flex: 1; 
        min-width: 125px; 
        display: flex; 
        flex-direction: column; 
        gap: 5px; 
    }

    .col-head { 
        background: #5a2111; 
        color: #fff; 
        padding: 3px 1px; 
        text-align: center; 
        text-transform: uppercase; 
        font-size: 0.32rem; 
        font-weight: 900;
        white-space: nowrap; 
        letter-spacing: -0.2px; 
    }
}

/* MOBILE VIEW (Screens 768px and narrower) */
@media (max-width: 768px) {
    .bracket-col { 
        min-width: 160px; /* Wider columns for easier tapping */
        gap: 8px;
    }

    .col-head { 
        background: #5a2111; 
        color: #fff; 
        padding: 6px 4px; 
        text-align: center; 
        text-transform: uppercase; 
        font-size: 0.65rem; /* Bigger, readable font for mobile */
        font-weight: 900;
        white-space: normal; /* ALLOWS text to wrap to two lines */
        line-height: 1.1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 35px; /* Ensures all headers stay same height */
    }

    .team-slot {
        padding: 8px 6px; /* Bigger tap targets for thumbs */
        font-size: 0.75rem;
    }

    .team-slot .seed {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* SHARED BOX STYLING */
.matchup-box { 
    background: #fff; 
    border: 1px solid #5a2111; 
    box-shadow: 2px 2px 0 #333; 
}

.team-slot { 
    cursor: pointer; 
    font-weight: 400; 
    border-bottom: 1px solid #eee; 
    display: flex; 
    align-items: center; 
    text-transform: uppercase;
}

.team-slot.selected { background: #5a2111; color: #fff; font-weight: 700; }
.team-slot.tbd { color: #ccc; background: #fafafa; }

.team-slot .seed { 
    background: #f0f0f0; color: #666; 
    display: flex; justify-content: center; align-items: center; 
    margin-right: 4px; border-radius: 1px;
}

.winner-announcement { 
    margin-top: 8px; padding: 10px; 
    background: #fffbeb; border: 1px solid #5a2111; 
    text-align: center; font-weight: 900; color: #5a2111;
    font-size: 0.8rem;
    box-shadow: 3px 3px 0 #5a2111;
}

/* --- 7. MODALS --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 10000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: #fff; width: 90%; max-width: 350px; border: 2px solid #5a2111; box-shadow: 5px 5px 0 #5a2111; }
.modal-header { background: #5a2111; color: #fff; padding: 10px; text-transform: uppercase; font-weight: 900; font-size: 0.75rem; }
.modal-body { padding: 12px; font-size: 0.75rem; }