/*
Theme Name: TheUAS Theme
Theme URI: https://alpha.theuas.in
Description: Universal Premier League — Day Match broadcast theme. Bright stadium daylight, sun-amber action accents, Stadium Navy scoreboard anchor, tier-metal colour coding. Pairs with UPL Engine v3.
Version: 3.0.0
Author: TheUAS
Author URI: https://alpha.theuas.in
Text Domain: theuas
*/

/* ──────────────────────────────────────────────────────────────
   v3.0 DAY MATCH DESIGN LANGUAGE
   - Display: Saira Condensed (jersey numbers / scoreboard)
   - Body:    Manrope · Mono: JetBrains Mono (tabular scores)
   - Sky-blue daylight field, white panels, sun-amber actions,
     Stadium Navy kept as the scoreboard anchor (topbar, table heads),
     Pitch Green = WIN/money, Leather Red = LOSS.
   - Token NAMES unchanged so UPL Engine v3 inherits the retune.
   ────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@500;600;700;800;900&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
    --pitch-green:    #16A34A;
    --pitch-green-d:  #15803D;
    --pitch-green-l:  #ECFDF3;
    --leather-red:    #DC2626;
    --leather-red-d:  #991B1B;
    --leather-red-l:  #FEF2F2;
    --stadium-navy:   #0E1B33;
    --stadium-navy-2: #16243F;
    /* the old floodlight blue is now the SUN: amber action family */
    --floodlight:     #B45309;     /* readable amber-700 for text links */
    --floodlight-l:   #FFF7E8;
    --sun:            #F6A417;
    --sun-2:          #F97316;
    --scoreboard-amber: #F6A417;
    --amber-l:        #FEF3C7;
    --boundary-white: #FAFBFC;
    --crease-white:   #FFFFFF;
    --ink-1: #0E1B33;
    --ink-2: #33405E;
    --ink-3: #5B6B8C;
    --ink-4: #94A1BB;
    --line-1: rgba(16,38,82,.10);
    --line-2: rgba(16,38,82,.18);
    --bg-soft: #EEF4FC;
    --bg-card: #FFFFFF;
    --shadow-sm: 0 2px 6px rgba(23,43,99,0.06);
    --shadow-md: 0 6px 16px rgba(23,43,99,0.09);
    --shadow-lg: 0 12px 32px rgba(23,43,99,0.12);
    --shadow-stadium: 0 8px 24px rgba(14,27,51,0.20);
    --r-xs: 4px; --r-sm: 6px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
    --font-display: 'Saira Condensed', 'Oswald', system-ui, sans-serif;
    --font-body:    'Manrope', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --topbar-h: 56px;
    --bnav-h:   62px;
    --content-max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--ink-1);
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom,0px)) !important;
    /* day-match sky: morning sun corners, green outfield wash, mowing stripes */
    background:
        radial-gradient(900px 460px at 8% -12%, rgba(255,193,77,.18), transparent 62%),
        radial-gradient(900px 460px at 92% -12%, rgba(255,193,77,.12), transparent 62%),
        radial-gradient(1100px 560px at 50% 118%, rgba(34,197,94,.13), transparent 62%),
        repeating-linear-gradient(90deg, transparent 0 72px, rgba(16,38,82,.022) 72px 144px),
        linear-gradient(180deg,#F6FAFF 0%, var(--bg-soft) 42%, #E7EFFB 100%);
    background-attachment: fixed;
}
/* broadcast paper grain */
body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none; z-index: -1; opacity: .03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

a { color: var(--floodlight); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--sun-2); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.005em;
    line-height: 1.12;
    color: var(--ink-1);
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; letter-spacing: 0; }

/* Tabular mono numbers throughout */
.num, .upl-score, .upl-char-pts, .upl-prof-stat strong,
.upl-col-stat, .upl-col-final, .upl-col-fp, .upl-col-pen,
.upl-squad-pts, .upl-pp-own, .upl-pp-opp-score, .upl-pp-verdict,
.upl-stat-card strong, .upl-match-id {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* === TOPBAR: navy scoreboard with a sun light-bar === */
.uas-topbar {
    background: linear-gradient(135deg, var(--stadium-navy) 0%, var(--stadium-navy-2) 70%, #1d3050 100%);
    padding: 0 18px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 14px rgba(14,27,51,0.22);
    border-bottom: 1px solid rgba(246,164,23,0.28);
}
.uas-topbar::before {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sun), var(--sun-2), var(--sun), transparent);
    opacity: .9;
}
.uas-topbar-title {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.uas-topbar-title::before {
    content: '';
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--sun), var(--sun-2));
    box-shadow: 0 0 10px rgba(246,164,23,.6);
    margin-right: 9px;
    vertical-align: 1px;
}
.uas-season-form { margin: 0; }
.uas-season-dropdown {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(246,164,23,0.4);
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all .15s;
}
.uas-season-dropdown:hover { background: rgba(246,164,23,0.22); border-color: var(--sun); }
.uas-season-dropdown:focus { outline: 2px solid var(--sun); outline-offset: 1px; }
.uas-season-dropdown option { color: var(--ink-1); background: #fff; }

/* === MAIN === */
.uas-main {
    min-height: calc(100vh - var(--topbar-h) - var(--bnav-h));
    padding-top: 10px;
}

/* === BOTTOM NAV (mobile dock) === */
.uas-bnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--bnav-h) + env(safe-area-inset-bottom,0px));
    padding-bottom: env(safe-area-inset-bottom,0px);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    display: flex;
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -10px 28px rgba(23,43,99,0.12);
    z-index: 300;
}
.uas-bnav::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent 8%, rgba(246,164,23,.55), transparent 92%);
    opacity: 0.8;
}
.uas-bnav a {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.15s;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    position: relative;
}
.uas-bnav-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.15s;
}
.uas-bnav a:hover { color: var(--floodlight); }
.uas-bnav a:hover .uas-bnav-icon { transform: scale(1.1); }
/* v3.0 FIX: markup emits class "active" on .uas-bnav-item; the old
   .uas-bnav-active selector never matched, so the dock had no active state.
   Both forms supported now. */
.uas-bnav a.active,
.uas-bnav a.uas-bnav-active { color: var(--floodlight); }
.uas-bnav a.active .uas-bnav-icon,
.uas-bnav a.uas-bnav-active .uas-bnav-icon { transform: scale(1.08); }
.uas-bnav a.active::after,
.uas-bnav a.uas-bnav-active::after {
    content: '';
    position: absolute;
    left: 22%; right: 22%; top: -1px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--sun), var(--sun-2));
    box-shadow: 0 2px 8px rgba(249,115,22,.45);
}
.uas-bnav-label { font-family: var(--font-body); }

/* === GENERIC === */
.uas-wrap { padding: 0 14px; max-width: var(--content-max); margin: 0 auto; }
.uas-card {
    background: var(--bg-card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line-1);
    overflow: hidden;
}

.uas-page-content {
    background: var(--bg-card);
    margin: 14px auto;
    padding: 24px 20px;
    border-radius: var(--r-lg);
    max-width: var(--content-max);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line-1);
    position: relative;
    overflow: hidden;
}
.uas-page-content::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(246,164,23,.7), transparent);
}
.uas-page-content h1 { font-size: 28px; margin-bottom: 10px; color: var(--stadium-navy); }
.uas-page-content h2 { margin: 20px 0 10px; color: var(--stadium-navy); }
.uas-page-content p { margin-bottom: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }

.uas-404, .uas-search-empty { text-align: center; padding: 60px 20px; }
.uas-404 h1, .uas-search-empty h2 {
    font-size: 64px;
    color: var(--leather-red);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

::selection { background: rgba(246,164,23,.35); color: var(--stadium-navy); }
::-moz-selection { background: rgba(246,164,23,.35); color: var(--stadium-navy); }

@media (pointer: fine) {
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
}

@media (min-width: 768px) {
    .uas-topbar { padding: 0 24px; height: 64px; --topbar-h: 64px; }
    .uas-topbar-title { font-size: 22px; }
    .uas-wrap, .uas-page-content { padding-left: 20px; padding-right: 20px; }
}
@media (min-width: 1024px) {
    .uas-bnav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 16px;
        border-radius: 18px;
        border: 1px solid var(--line-2);
        height: var(--bnav-h);
        padding-bottom: 0;
        box-shadow: var(--shadow-lg);
    }
    .uas-bnav::before { border-radius: 18px 18px 0 0; }
    body { padding-bottom: calc(var(--bnav-h) + 32px) !important; }
}

/* === MOTION === */
@keyframes uas-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.92); }
}
.uas-live-pulse { animation: uas-pulse 1.6s ease-in-out infinite; }

.uas-loading {
    text-align: center;
    padding: 40px;
    color: var(--ink-3);
    font-size: 13px;
}

@media print {
    .uas-topbar, .uas-bnav { display: none !important; }
    body { background: #fff !important; padding-bottom: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   v3.0 — Engine hero handshake (theme h1 must not shrink the
   cinematic masthead rendered by UPL Engine)
   ════════════════════════════════════════════════════════════════ */
.uas-page-content .upl-hero-title-massive,
body .upl-hero-title-massive {
    margin-bottom: 0 !important;
    font-size: clamp(80px, 18vw, 200px) !important;
}
