/* Spot the Ball — grid overlay (dynamic size via --spotball-cols / --spotball-rows) */

.spotball-page {
    padding: 1.5rem 0 3rem;
}

.spotball-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0 0 .35rem;
}

.spotball-hero-title .accent {
    color: var(--accent, #facc15);
}

.spotball-board {
    max-width: 1000px;
    margin: 0 auto;
}

.spotball-col-labels,
.spotball-row-labels {
    display: grid;
    font-weight: 800;
    font-size: .75rem;
    user-select: none;
}

.spotball-col-labels {
    grid-template-columns: repeat(var(--spotball-cols, 10), 1fr);
    gap: 0;
}

.spotball-col-labels span {
    text-align: center;
    padding: .2rem 0;
    background: #facc15;
    color: #111;
    border: 1px solid #ca8a04;
    font-size: clamp(.45rem, 1vw, .7rem);
    line-height: 1.1;
    overflow: hidden;
}

.spotball-row-labels {
    grid-template-rows: repeat(var(--spotball-rows, 10), 1fr);
}

.spotball-row-labels span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e3a5f;
    color: #fff;
    border: 1px solid #0f172a;
    min-width: 20px;
    font-size: clamp(.45rem, .9vw, .65rem);
    line-height: 1;
    padding: 0 1px;
}

.spotball-board-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0;
    align-items: stretch;
}

.spotball-image-wrap {
    position: relative;
    border: 4px solid #facc15;
    background: #000;
    line-height: 0;
}

.spotball-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.spotball-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--spotball-cols, 10), 1fr);
    grid-template-rows: repeat(var(--spotball-rows, 10), 1fr);
    pointer-events: auto;
}

.spotball-cell {
    border: 1px solid rgba(255, 255, 255, .35);
    background: transparent;
    cursor: crosshair;
    padding: 0;
    margin: 0;
    appearance: none;
    transition: background .12s ease;
}

.spotball-cell:hover {
    background: rgba(250, 204, 21, .25);
}

.spotball-cell.is-selected {
    background: rgba(250, 204, 21, .55);
    box-shadow: inset 0 0 0 2px #facc15;
}

.spotball-cell.is-answer {
    background: rgba(34, 197, 94, .45);
    box-shadow: inset 0 0 0 2px #22c55e;
}

.spotball-grid--picker .spotball-cell {
    border-color: rgba(255, 255, 255, .2);
}

.spotball-grid--picker .spotball-cell:hover {
    background: rgba(250, 204, 21, .15);
}

.spotball-grid--play .spotball-cell {
    border-color: rgba(255, 255, 255, .55);
}

.spotball-grid--play .spotball-cell:hover {
    background: rgba(250, 204, 21, .35);
    border-color: rgba(250, 204, 21, .85);
}

.spotball-grid--play .spotball-cell.is-selected {
    background: rgba(250, 204, 21, .6);
    box-shadow: inset 0 0 0 2px #facc15;
}

.spotball-pin {
    position: absolute;
    z-index: 10;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 3px solid #ef4444;
    border-radius: 50%;
    background: rgba(239, 68, 68, .28);
    box-shadow: 0 0 0 2px #fff, 0 2px 14px rgba(0, 0, 0, .45);
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: auto;
    appearance: none;
    transition: transform .1s ease, box-shadow .1s ease;
}

.spotball-pin::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: #ef4444;
}

.spotball-pin.is-dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 0 0 3px #fff, 0 4px 18px rgba(0, 0, 0, .5);
}

.spotball-pin.hidden {
    display: none;
}

.spotball-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.25rem;
}

.spotball-pick {
    font-weight: 600;
}

.spotball-status {
    min-height: 1.25rem;
    font-weight: 600;
}

.spotball-status.is-success { color: var(--success); }
.spotball-status.is-info { color: var(--primary); }

/* Admin upload */
.spotball-dropzone {
    border: 2px dashed var(--border, #cbd5e1);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    margin: 1rem 0;
    background: var(--surface-alt, rgba(148, 163, 184, .08));
    transition: border-color .15s ease, background .15s ease;
}

.spotball-dropzone-text {
    margin: 0;
    font-weight: 600;
}

.spotball-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.spotball-dropzone-hint {
    font-size: .85rem;
    margin: .35rem 0 0;
}

.spotball-admin-preview.hidden {
    display: none;
}

.spotball-picker-hint {
    margin: 0 0 .5rem;
}

.spotball-selected {
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--primary);
}

.spotball-thumb {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--text-muted);
}

.form-row input[type="text"],
.form-row select {
    width: 100%;
    max-width: 420px;
}

.spotball-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.75rem;
}

.spotball-filter {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.spotball-filter:hover {
    background: var(--surface-alt);
}

.spotball-filter.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.spotball-filter-count {
    font-size: .75rem;
    font-weight: 700;
    opacity: .75;
}

.spotball-tier + .spotball-tier {
    margin-top: 2.5rem;
}

.spotball-tier-title {
    margin: 0 0 .25rem;
    font-size: 1.35rem;
}

.spotball-tier-desc {
    margin: 0 0 1rem;
}

.spotball-card-thumb {
    margin: -1rem -1rem 1rem;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #111;
}

.spotball-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spotball-hero-title .accent {
    color: #facc15;
}

@media (max-width: 640px) {
    .spotball-row-labels span {
        min-width: 22px;
        font-size: .6rem;
    }

    .spotball-col-labels span {
        font-size: .65rem;
        padding: .25rem 0;
    }
}
