/* === PLAY OR POSTPONE — Play Score UI === */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
    --bg-0: #050814;
    --bg-1: #0a1024;
    --panel: rgba(12, 22, 48, 0.72);
    --panel-solid: #0c1630;
    --panel-border: rgba(80, 140, 255, 0.22);
    --panel-glow: rgba(56, 189, 248, 0.08);
    --text: #e8eefc;
    --muted: #8b9bb8;
    --label: #6b7c99;
    --line: rgba(120, 160, 230, 0.18);
    --green: #22e36a;
    --green-dim: rgba(34, 227, 106, 0.15);
    --yellow: #f5c542;
    --orange: #ff8a3d;
    --red: #ff4d5e;
    --blue: #3b9eff;
    --cyan: #2dd4bf;
    --purple: #a78bfa;
    --radius: 16px;
    --radius-sm: 12px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html {
    font-size: 16px;
    background: var(--bg-0);
}

body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    line-height: 1.45;
    background: radial-gradient(1200px 600px at 15% -10%, rgba(56, 120, 255, 0.18), transparent 55%),
                radial-gradient(900px 500px at 90% 20%, rgba(120, 40, 200, 0.16), transparent 50%),
                linear-gradient(180deg, #070b18 0%, #050814 45%, #04060f 100%);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% 80%, rgba(30, 80, 180, 0.12), transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 70%, rgba(90, 40, 160, 0.14), transparent 55%);
    opacity: 0.9;
}

.app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(80, 140, 255, 0.04) 0, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(140, 80, 255, 0.05) 0, transparent 35%);
}

/* --- Top bar --- */
.top-bar-wrap {
    position: relative;
    z-index: 10;
    padding: 18px 20px 8px;
}

.top-bar {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 2px;
    text-decoration: none;
    line-height: 0;
}

.brand-logo {
    display: block;
    height: 52px;
    width: auto;
    max-width: min(280px, 42vw);
    object-fit: contain;
    object-position: left center;
}

.input-row {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
    min-width: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--label);
    text-transform: uppercase;
    padding-left: 2px;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(8, 14, 32, 0.85);
    border: 1px solid rgba(100, 140, 220, 0.28);
    border-radius: 12px;
    padding: 0 10px;
    height: 44px;
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-control:focus-within {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.field-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.field-icon svg { width: 16px; height: 16px; }

.field-control input,
.field-control select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    background-color: transparent;
    border: 0;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 500;
    width: 100%;
    min-width: 0;
    outline: none;
    height: 100%;
    /* Prevent UA white flash on focus / selection */
    color-scheme: dark;
}

.field-control input:focus,
.field-control input:focus-visible,
.field-control input:active,
.field-control select:focus,
.field-control select:focus-visible,
.field-control select:active {
    background: transparent;
    background-color: transparent;
    color: var(--text);
    outline: none;
    box-shadow: none;
}

/* Keep autofilled fields on the dark control background */
.field-control input:-webkit-autofill,
.field-control input:-webkit-autofill:hover,
.field-control input:-webkit-autofill:focus,
.field-control input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    transition: background-color 99999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px transparent inset;
    -webkit-box-shadow: 0 0 0 1000px rgba(8, 14, 32, 0.85) inset;
}

.field-control select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-color: transparent;
    padding-right: 14px;
    cursor: pointer;
}

.field-control input::placeholder { color: #475569; }

.field-control input[type="date"],
.field-control input[type="time"] {
    background-color: transparent;
    cursor: pointer;
}

/* One calendar control only (right-side native indicator); click opens picker via JS */
.field-control input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.75;
    filter: invert(0.7);
}

.field-control-split {
    gap: 2px;
    padding-left: 8px;
    padding-right: 6px;
}

/* Breathing room between clock icon and time dropdown */
.field-time .field-control-split .field-icon {
    margin-right: 4px;
}

.field-control-split select {
    width: auto;
    flex: 0 0 auto;
    background-position: right 0 center;
    padding-right: 12px;
    min-width: 0;
}

.field-control-split select[name="time12"] {
    min-width: 3.6rem;
    flex: 1 1 auto;
}

.field-control-split select[name="ampm"] {
    min-width: 2.4rem;
    flex: 0 0 auto;
}

.field-zip { flex: 1 1 120px; max-width: 150px; }
.field-sport { flex: 1 1 110px; max-width: 140px; }
.field-date { flex: 0 1 132px; max-width: 148px; }
.field-time { flex: 0 0 132px; max-width: 132px; }
.field-duration { flex: 0 0 88px; max-width: 88px; }

.field-duration .field-control {
    padding-left: 8px;
    padding-right: 8px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-bottom: 0;
}

.btn-primary {
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 45%, #7c3aed 100%);
    color: #fff;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
    transition: transform 0.12s ease, filter 0.12s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(100, 140, 220, 0.25);
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(100, 140, 220, 0.45); }

.btn-icon-reset {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(100, 140, 220, 0.25);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn-icon-reset svg {
    width: 18px;
    height: 18px;
}
.btn-icon-reset:hover {
    color: var(--text);
    border-color: rgba(100, 140, 220, 0.45);
    background: rgba(8, 14, 32, 0.55);
}

/* --- Main --- */
.ws-main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card {
    background: linear-gradient(180deg, rgba(16, 28, 58, 0.85) 0%, rgba(10, 18, 40, 0.9) 100%);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

.card-empty,
.card-loading {
    padding: 36px 28px;
    text-align: center;
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 8px;
}

.empty-copy {
    color: var(--muted);
    font-size: 0.98rem;
    max-width: 36rem;
    margin: 0 auto;
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: #93c5fd;
    margin-bottom: 16px;
}

.loading-bar {
    height: 6px;
    width: min(320px, 100%);
    margin: 0 auto;
    border-radius: 999px;
    background: rgba(30, 50, 90, 0.9);
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    animation: load-slide 1.4s ease-in-out infinite;
}

@keyframes load-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* --- Results --- */
.results {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.event-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(14, 26, 54, 0.9) 0%, rgba(10, 18, 40, 0.92) 100%);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.event-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
}

.event-icon {
    width: 18px;
    height: 18px;
    color: #38bdf8;
    display: grid;
    place-items: center;
}
.event-icon svg { width: 18px; height: 18px; }

.event-sep {
    width: 1px;
    height: 18px;
    background: var(--line);
}

/* Score card */
.score-card {
    padding: 28px 28px 0;
    overflow: hidden;
}

.score-layout {
    display: flex;
    align-items: center;
    gap: clamp(20px, 4vw, 48px);
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 8px;
}

.ws-dial-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.ws-dial-chart-box {
    width: clamp(200px, 28vw, 280px);
    aspect-ratio: 1;
    position: relative;
    filter: drop-shadow(0 0 28px rgba(34, 227, 106, 0.22));
}

.ws-dial-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.ws-dial-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    box-sizing: border-box;
}

.ws-dial-score {
    font-size: clamp(3.2rem, 8vw, 4.6rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--green);
    text-shadow: 0 0 28px rgba(34, 227, 106, 0.35);
}

.ws-dial-center-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: 2px;
}

.ws-dial-scale {
    width: clamp(200px, 28vw, 280px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.scale-track {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(80, 100, 140, 0.35);
    position: relative;
    overflow: hidden;
}

.scale-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22e36a, #4ade80);
    box-shadow: 0 0 10px rgba(34, 227, 106, 0.5);
    transition: width 0.6s ease;
}

.ws-score-label {
    margin-top: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.ws-decision-info {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 420px;
}

.ws-recommendation {
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--green);
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(34, 227, 106, 0.25);
    padding-bottom: 10px;
    border-bottom: 3px solid currentColor;
    display: inline-block;
    min-width: 4.5ch;
}

.ws-confidence {
    margin-top: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.ws-confidence .sep {
    color: rgba(125, 211, 252, 0.35);
    margin: 0 0.55em;
}

.ws-reason-short {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 34rem;
}

/* Metrics */
.ws-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.ws-metric {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    min-width: 0;
}
.ws-metric:last-child { border-right: 0; }

.ws-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.ws-metric-icon svg { width: 22px; height: 22px; }

.ws-metric-icon.rain { color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.ws-metric-icon.temp { color: #fb923c; background: rgba(251, 146, 60, 0.12); }
.ws-metric-icon.wind { color: #2dd4bf; background: rgba(45, 212, 191, 0.12); }
.ws-metric-icon.gust { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }

.ws-metric-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ws-metric-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.ws-metric-value {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.ws-metric-value.rain { color: #38bdf8; }
.ws-metric-value.temp { color: #fb923c; }
.ws-metric-value.wind { color: #2dd4bf; }
.ws-metric-value.gust { color: #a78bfa; }

/* Risk banner */
.risk-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 227, 106, 0.35);
    background: linear-gradient(180deg, rgba(12, 40, 28, 0.75) 0%, rgba(8, 24, 20, 0.85) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.risk-banner.risk-mid {
    border-color: rgba(245, 197, 66, 0.4);
    background: linear-gradient(180deg, rgba(48, 36, 10, 0.8) 0%, rgba(28, 20, 8, 0.88) 100%);
}
.risk-banner.risk-high {
    border-color: rgba(255, 77, 94, 0.45);
    background: linear-gradient(180deg, rgba(48, 14, 20, 0.82) 0%, rgba(28, 8, 12, 0.9) 100%);
}

.risk-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--green);
    margin-top: 1px;
}
.risk-banner.risk-mid .risk-icon { color: var(--yellow); }
.risk-banner.risk-high .risk-icon { color: var(--red); }
.risk-icon svg { width: 28px; height: 28px; }

.risk-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--green);
    margin-bottom: 4px;
}
.risk-banner.risk-mid .risk-title { color: var(--yellow); }
.risk-banner.risk-high .risk-title { color: #ff7a88; }

.risk-copy {
    color: #b7c4d8;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Learn more */
.learn-more-wrap {
    display: flex;
    justify-content: center;
    padding: 4px 0 2px;
}

.learn-more-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #7dd3fc;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}
.learn-more-btn:hover {
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.08);
}
.learn-more-btn[aria-expanded="true"] .learn-more-chevron {
    transform: rotate(180deg);
}
.learn-more-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.85em;
}

.details-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fade-in 0.25s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.details-card {
    padding: 18px 20px 8px;
}

.details-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.ws-models {
    display: flex;
    flex-direction: column;
}

.ws-model {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
.ws-model:last-child { border-bottom: 0; }

.ws-model-name {
    font-weight: 700;
    color: #93c5fd;
    min-width: 120px;
}

.ws-model-data {
    color: var(--muted);
    text-align: right;
}

.ws-model-error {
    color: var(--red);
    font-weight: 600;
}

/* Alerts */
.ws-alert {
    background: linear-gradient(180deg, rgba(80, 18, 28, 0.9) 0%, rgba(40, 10, 16, 0.95) 100%);
    border: 1px solid rgba(255, 77, 94, 0.45);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    color: #fecdd3;
}

.ws-alert-darkness {
    background: linear-gradient(180deg, rgba(72, 40, 12, 0.92) 0%, rgba(36, 20, 8, 0.95) 100%);
    border-color: rgba(251, 146, 60, 0.45);
    color: #ffedd5;
}

.ws-alert-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fda4af;
    margin-bottom: 4px;
}
.ws-alert-darkness .ws-alert-title { color: #fdba74; }

.ws-alert a {
    color: #7dd3fc;
    text-decoration: underline;
}

.ws-disclaimer {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    padding: 4px 8px 8px;
    line-height: 1.5;
}

.ws-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #475569;
    font-size: 0.78rem;
    padding: 14px 16px 22px;
    letter-spacing: 0.02em;
}

.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .ws-metrics { grid-template-columns: repeat(2, 1fr); }
    .ws-metric:nth-child(2) { border-right: 0; }
    .ws-metric:nth-child(1),
    .ws-metric:nth-child(2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 1100px) {
    .top-bar,
    .input-row { flex-wrap: wrap; }
}

@media (max-width: 720px) {
    .top-bar-wrap { padding: 12px 12px 4px; }
    .top-bar { gap: 12px; flex-wrap: wrap; }
    .brand {
        width: 100%;
        justify-content: center;
        padding: 0 12px;
        box-sizing: border-box;
    }
    .brand-logo {
        height: auto;
        width: 100%;
        max-width: min(420px, calc(100vw - 48px));
        object-position: center center;
    }
    .input-row { width: 100%; flex-wrap: wrap; }
    .field-zip,
    .field-sport,
    .field-date,
    .field-time,
    .field-duration { flex: 1 1 calc(50% - 10px); max-width: none; }
    .field-time { flex: 1 1 100%; }
    .top-bar-actions {
        width: 100%;
    }
    .btn-primary { flex: 1; }
    .btn-icon-reset { flex: 0 0 44px; }
    .ws-main { padding: 12px 12px 28px; }
    .score-card { padding: 20px 16px 0; }
    .score-layout { flex-direction: column; text-align: left; align-items: center; }
    .ws-decision-info { text-align: center; max-width: none; }
    .ws-reason-short { margin-left: auto; margin-right: auto; }
    .event-strip { gap: 10px; }
    .event-sep { display: none; }
    .ws-model { flex-direction: column; align-items: flex-start; }
    .ws-model-data { text-align: left; }
}

@media (max-width: 420px) {
    .field-zip,
    .field-sport,
    .field-date,
    .field-duration { flex: 1 1 100%; }
    .ws-metrics { grid-template-columns: 1fr 1fr; }
}
