/*
 * Pitch Grid Reference component
 * ------------------------------
 * Compact 5x4 visual grid showing all 20 CFB 26 recruiting pitches in their
 * in-game spatial arrangement. Used as a secondary reference on all three
 * Pitch Finder variant pages (Signal, Detective, Dashboard).
 *
 * State machine (set via `data-grid-status` on each cell):
 *   default      - no input yet, neutral grey
 *   viable       - still possible, green tinted
 *   confirmed    - all 3 motivations matched, gold glow
 *   eliminated   - any motivation marked No, red and faded
 *
 * Colors use DaisyUI v5 semantic tokens (--color-*) with color-mix for alpha.
 */

.pf-pitch-grid {
    display: inline-block;
}

.pf-pitch-grid-label {
    font-size: 0.65rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: color-mix(in oklch, var(--color-base-content) 50%, transparent);
    margin-bottom: 0.5rem;
}

/*
 * Grid container draws the outer border and, via a 1px gap filled by its
 * background color, the internal lines between cells. `overflow: hidden`
 * clips the cell corners to the container's rounded border.
 */
.pf-pitch-grid-cells {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: color-mix(in oklch, var(--color-base-content) 15%, transparent);
    border: 1px solid color-mix(in oklch, var(--color-base-content) 15%, transparent);
    border-radius: 0.5rem;
    overflow: hidden;
    width: max-content;
}

.pf-grid-cell {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: var(--color-base-200);
    color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
    cursor: pointer;
    transition:
        filter 150ms ease,
        background-color 150ms ease,
        color 150ms ease,
        opacity 150ms ease,
        box-shadow 200ms ease;
    position: relative;
    padding: 0;
}

.pf-grid-cell:hover {
    /* Brighten in place (no transform) so hovering doesn't jump over the
     * gridline neighbors or clip against the container's overflow edge. */
    filter: brightness(1.25);
    z-index: 10;
}

.pf-grid-cell:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    z-index: 10;
}

.pf-grid-cell svg {
    width: 1.1rem;
    height: 1.1rem;
}

/* State: viable (also the default state before any input) */
.pf-grid-cell[data-grid-status="viable"],
.pf-grid-cell:not([data-grid-status]) {
    background: var(--color-base-100);
    color: var(--color-success);
}

/* State: confirmed (all 3 motivations matched) */
.pf-grid-cell[data-grid-status="confirmed"] {
    background: var(--color-base-100);
    color: var(--color-warning);
    box-shadow: inset 0 0 0 2px var(--color-warning);
}

/* State: eliminated (any motivation ruled out) */
.pf-grid-cell[data-grid-status="eliminated"] {
    background: var(--color-base-100);
    color: color-mix(in oklch, var(--color-error) 60%, transparent);
}

/* Desktop: slightly larger cells */
@media (min-width: 768px) {
    .pf-grid-cell {
        width: 3rem;
        height: 3rem;
    }
    .pf-grid-cell svg {
        width: 1.35rem;
        height: 1.35rem;
    }
}

/*
 * Click-to-scroll target flash animation
 * --------------------------------------
 * When a user clicks a grid cell, JS scrolls the corresponding pitch row
 * into view in the main pitch list and applies this class for a brief
 * highlight, helping the eye find the row.
 */
@keyframes pf-grid-jump {
    0%   { background-color: color-mix(in oklch, var(--color-warning) 35%, transparent); }
    100% { background-color: transparent; }
}

.pf-grid-jump-flash {
    animation: pf-grid-jump 800ms ease-out;
}
