/**
 * Sideline Command — splash CSS.
 *
 * Shared across all athlete pages (index, schedule, messages, thread, mykid,
 * game, settings). Pages just include this file in <head> and load
 * /athlete/js/splash.js which injects the DOM + manages the hide lifecycle.
 *
 * Engineering Playbook #42 (preloader-always-on sweep).
 */

body.sc-splash-active { overflow: hidden; background: #0a0d14; }

#sc-splash {
    position: fixed; inset: 0; z-index: 9999;
    background: #0a0d14;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 1;
    transition: opacity 0.45s ease;
    pointer-events: auto;
    overflow: hidden;
    isolation: isolate;
}
#sc-splash.is-hiding { opacity: 0; pointer-events: none; }

/* Color wash — SC green up top, blue + gold tucked into the corners
   so the eye still reads "primary green" while the broadcast palette
   is hinted at. Sits behind the field grid + logo. */
#sc-splash::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 90% 55% at 50% 0%,   rgba(34, 197, 94, 0.22), transparent 62%),
        radial-gradient(ellipse 70% 60% at 100% 100%, rgba(59, 130, 246, 0.10), transparent 60%),
        radial-gradient(ellipse 70% 60% at 0% 100%,   rgba(245, 158, 11, 0.07), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
/* Field grid — 1px green lines, 56px cells, masked to fade out at the
   edges so it feels like a stadium overlay, not a checkerboard. */
#sc-splash::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(34, 197, 94, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, black 25%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, black 25%, transparent 90%);
    pointer-events: none;
    z-index: 0;
}

#sc-splash .sc-splash-mark {
    position: relative; z-index: 2;
    width: 180px;
    height: 180px;
    max-width: 56vw;
    max-height: 56vw;
    object-fit: contain;
    border-radius: 28%; /* iOS-style rounded square — same shape as the home-screen icon */
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.45)) drop-shadow(0 0 24px rgba(34,197,94,0.18));
    animation: sc-splash-breathe 2.6s ease-in-out infinite;
}

/* Signal sweep — a thin line under the logo with a green light passing
   through left-to-right. Reads as "live, ready, on the air". */
#sc-splash .sc-splash-bar {
    position: relative; z-index: 2;
    margin-top: 36px;
    width: 96px; height: 1.5px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
    border-radius: 1px;
}
#sc-splash .sc-splash-bar::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 1), transparent);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
    animation: sc-splash-sweep 1.5s linear infinite;
}

/* Broadcast eyebrow — pulsing dot + status label. Reinforces the
   "live signal" read without competing with the logo for attention. */
#sc-splash .sc-splash-status {
    position: relative; z-index: 2;
    margin-top: 22px;
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Saira Condensed', system-ui, sans-serif;
    font-size: 11px; font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
#sc-splash .sc-splash-status::before {
    content: '';
    width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.85);
    animation: sc-splash-pulse 1.4s ease-in-out infinite;
}

@keyframes sc-splash-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.035); }
}
@keyframes sc-splash-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes sc-splash-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.65); }
}
@media (prefers-reduced-motion: reduce) {
    #sc-splash .sc-splash-mark { animation: none; }
    #sc-splash .sc-splash-bar::after { animation-duration: 2.4s; }
    #sc-splash .sc-splash-status::before { animation: none; }
}
