/* Fred Leak - four sub-competitions (Individual, Team of 4, Ladies, Juniors)
   sharing one page, tabbed. The scorecard/shot-box/shooter-picker styling is
   all borrowed from match.css via the .edit-mode class, same as every other
   competition page - this file only covers the tab bar and the bits unique
   to Fred Leak's layout (team cards, entrant rows, tag lists). */

.fl-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.fl-tab-btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0d6c8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fl-tab-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.fl-tab-btn.active {
    color: #18181b;
    background: #d4a017;
    border-color: #d4a017;
}

.fl-section[hidden] {
    display: none;
}

/* Standings table on each tab, then the next heading straight after it
   ("Round 1"/"Teams"/"Entrants") - match.css's .column-title only has a
   margin-bottom, so without this the heading sits flush against the table
   above it. */
#flRound1StandingsWrap + h3.column-title,
#flIndividualStandingsWrap + h3.column-title,
#flTeamsStandingsWrap + h3.column-title,
#flLadiesStandingsWrap + h3.column-title,
#flJuniorsStandingsWrap + h3.column-title {
    margin-top: 24px;
}

#flLockBar[hidden] {
    display: none;
}

/* Every tab's own scorecard table, then its action row right below it
   ("Compute Cut"/"Start Tie-Breaker"/"Start Round 2 Anyway") - same
   #wrap + .practice-actions spacing convention as pairs/senior-presidents'
   own CSS, since .practice-actions itself has no margin of its own. */
#flRound1Wrap + .practice-actions,
#flTeamsWrap + .practice-actions,
#flLadiesWrap + .practice-actions,
#flJuniorsWrap + .practice-actions {
    margin-top: 24px;
}

/* Every tab's own action row sits right above whichever section(s) it can
   open (the cut tie-breaker, Round 2, or a sub-competition's own
   tie-breaker) - each is a boxed .section with padding inside it, but
   nothing spaces its top edge from the button row above, so it sits flush
   against it without this. General sibling (~), not adjacent (+): the
   first .section right after the actions row is sometimes the hidden one
   (e.g. the cut tie-breaker once it's resolved and Round 2 has opened),
   and + would only ever reach that one, leaving whichever visible section
   comes after it with no gap at all. */
.practice-actions ~ .section {
    margin-top: 24px;
}

.fl-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* Ladies/Juniors' Remove button sits in the shooter cell right under the
   name/team (practice.css's .practice-shooter-team is display:block, so it
   always drops onto its own line below them) - a left margin wouldn't
   create any visible gap there, so this needs space above it instead. */
.fl-tag-remove {
    display: inline-block;
    margin-top: 6px;
}

/* One card per Team of 4 - a single table (member picker + full Round 1
   scorecard per row, see JS/fred-leak-competition.js) plus a running team
   total. Ladies/Juniors use the same one-table pattern, no card wrapper
   needed since there's only ever one list on those tabs. */
.fl-team-card {
    margin-bottom: 24px;
}

.fl-team-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.results-summary {
    margin: 20px auto 0;
    max-width: 360px;
    border: 2px solid #d4a017;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 14px rgba(212, 160, 23, 0.25);
}

.results-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.04);
}

.results-summary-table td {
    padding: 10px 14px;
    text-align: left;
    color: #e0d6c8;
    font-size: 0.92rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-summary-table tr:first-child td {
    border-top: none;
}

.results-place {
    font-weight: 700;
    color: #d4a017;
    white-space: nowrap;
}

.results-row-winner {
    background: rgba(212, 160, 23, 0.18);
}

.results-row-winner td {
    color: #ffd873;
}

.results-row-winner .results-place {
    color: #d4a017;
    text-shadow: 0 0 8px rgba(212, 160, 23, 0.4);
}

/* "+ New Shooter" dialog (Individual roster picker) - same styling as
   pairs-competition.css's own copy, duplicated here since this page
   doesn't link that stylesheet. */

.new-shooter-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
}

.new-shooter-card {
    background: #18181b;
    color: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: min(400px, 100%);
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    font: inherit;
    box-sizing: border-box;
}

.new-shooter-card h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: #d4a017;
}

.new-shooter-field {
    margin-bottom: 14px;
}

.new-shooter-label {
    display: block;
    font-size: 0.85rem;
    color: #e0d6c8;
    margin-bottom: 6px;
}

.new-shooter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 1rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.new-shooter-input:focus {
    border-color: #c41e3a;
}

.new-shooter-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    min-height: 1.1em;
    color: #ffb3c0;
}

.new-shooter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
}

.new-shooter-actions button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    color: #ffffff;
}

.new-shooter-cancel {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.new-shooter-go {
    border: none;
    background: linear-gradient(90deg, #c41e3a, #d4a017);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.new-shooter-go:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
