/*
 * Football board: the formation row of the Log Play pop-up and the Call play list
 * (CR req_DR8LObQeKXYo, playbook stages 2 and 3; public/js/score-keeper/football-playbook-board.js).
 * The board's own colour variables and the score-keeper-v2 accent; no new colour.
 */

/* ---- Formation row (Log Play pop-up) ---- */
.fb-formation {
    margin: 0 0 0.625rem;
}

.fb-formation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.fb-formation-head .play-log-label {
    min-width: 0;
    text-align: left;
}

.fb-formation-sides {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.fb-formation-side {
    min-height: 36px;
    padding: 0.25rem 0.75rem;
    border: 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.fb-formation-side.active {
    background: var(--sv2-accent, #6366f1);
    color: #ffffff;
}

/* One row that scrolls sideways: the list never pushes the yards and the jersey numbers down. */
.fb-formation-chips {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.fb-formation-chip {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 56px;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
}

.fb-formation-chip.active {
    background: var(--sv2-accent, #6366f1);
    border-color: var(--sv2-accent, #6366f1);
    color: #ffffff;
}

.fb-formation-same {
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.1;
    opacity: 0.9;
}

.fb-formation-add {
    display: flex;
    gap: 0.375rem;
}

.fb-formation-add .play-log-input {
    flex: 1;
    min-width: 0;
}

.fb-formation-add-btn {
    min-height: 44px;
    padding: 0 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* The play card this play was called from. */
.fb-called {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    border: 1px solid var(--sv2-accent, #6366f1);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fb-called[hidden],
.fb-formation[hidden] {
    display: none;
}

.fb-called-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-called-clear {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

/* Free game: one locked row that opens the Pro prompt. */
.fb-formation-locked {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin: 0 0 0.625rem;
    padding: 0.375rem 0.5rem;
    border: 1px dashed rgba(43, 168, 255, 0.45);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* ---- Call play (the list pop-up) ---- */
.fb-call-search {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    margin-bottom: 0.5rem;
    font-size: 16px;
}

.fb-call-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fb-call-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 48px;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.fb-call-num {
    flex: 0 0 2.5rem;
    font-size: 1.125rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--sv2-accent, #6366f1);
}

.fb-call-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fb-call-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-call-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.fb-call-empty,
.fb-call-foot {
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.fb-call-link {
    color: var(--sv2-accent, #6366f1);
    font-weight: 700;
}

/* ---- Call play, stage 4: the call sheet by situation and the install list ---- */
.fb-call-now {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fb-call-install {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.75rem;
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.fb-call-install-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 44px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.fb-call-card--match {
    border-color: var(--sv2-accent, #6366f1);
}

.fb-call-sit {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sv2-accent, #6366f1);
}
