/* ==========================================================================
           1. GLOBAL RESET & TOUCH DEFAULTS
           ========================================================================== */
        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        /* ==========================================================================
           2. CSS CUSTOM PROPERTIES
           - Updated at runtime by applyThemeColors().
           ========================================================================== */
        :root {
            --bg-start: #60a5fa;
            --bg-end: #1e3a8a;
            --card-bg-start: rgba(15, 23, 42, 0.92);
            --card-bg-end: rgba(9, 13, 24, 0.96);
            --card-spotlight: rgba(59, 130, 246, 0.14);
            --btn-start: #2563eb;
            --btn-end: #1d4ed8;
        }

        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            margin: 0;
            padding: 1.25rem 1rem;
            padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
            color: #f8fafc;
            -webkit-font-smoothing: antialiased;
        }

        /* ==========================================================================
           3. CARD CONTAINER & CLOAKING STATE
           ========================================================================== */
        .card {
            position: relative;
            overflow: hidden;
            background: 
                radial-gradient(120% 55% at 50% 0%, var(--card-spotlight) 0%, transparent 70%),
                linear-gradient(165deg, var(--card-bg-start) 0%, var(--card-bg-end) 100%);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            max-width: 440px;
            width: 100%;
            padding: 1.9rem 1.5rem 1.5rem 1.5rem;
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.11);
            box-shadow: 
                0 26px 52px rgba(0, 0, 0, 0.6),
                0 6px 16px rgba(0, 0, 0, 0.38),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
            text-align: center;
            opacity: 1;
            transform: translateY(0) scale(1);
            transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        }

        /* Initial hidden state prior to parameter validation */
        .card.cloak {
            visibility: hidden;
            opacity: 0;
            transform: translateY(16px) scale(0.97);
            transition: none;
        }

        /* Child element transition delays on uncloak */
        .card > * {
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .card.cloak > * {
            opacity: 0;
            transform: translateY(10px);
            transition: none;
        }
        .card > *:nth-child(1) { transition-delay: 0.03s; }
        .card > *:nth-child(2) { transition-delay: 0.08s; }
        .card > *:nth-child(3) { transition-delay: 0.13s; }
        .card > *:nth-child(4) { transition-delay: 0.18s; }
        .card > *:nth-child(5) { transition-delay: 0.22s; }

        /* ==========================================================================
           4. STATUS BADGE & INDICATOR ANIMATION
           ========================================================================== */
        .slip-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            background: rgba(16, 185, 129, 0.13);
            color: #34d399;
            border: 1px solid rgba(52, 211, 153, 0.28);
            box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12);
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0.09em;
            text-transform: uppercase;
            padding: 0.36rem 0.8rem;
            border-radius: 9999px;
            margin-bottom: 0.9rem;
            user-select: none;
        }
        .slip-badge-dot {
            width: 7px;
            height: 7px;
            background-color: #10b981;
            border-radius: 50%;
            box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
            animation: dot-pulse 4s infinite;
        }
        @keyframes dot-pulse {
            0% {
                transform: scale(1);
                opacity: 1;
                animation-timing-function: cubic-bezier(0.22, 0.05, 0.45, 0.95);
            }
            52.5% {
                transform: scale(1.35);
                opacity: 0.55;
                animation-timing-function: cubic-bezier(0.55, 0.05, 0.78, 1.05);
            }
            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* ==========================================================================
           4b. FANDUEL DETECTION BANNER
           ========================================================================== */
        .fanduel-banner {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
            border: 1px solid rgba(255, 255, 255, 0.9);
            box-shadow: 
                0 4px 20px rgba(0, 0, 0, 0.35),
                0 0 16px rgba(20, 147, 255, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 1);
            border-radius: 14px;
            padding: 0.75rem 1rem;
            margin-bottom: 1.15rem;
            user-select: none;
            transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
        }
        .fanduel-logo-img {
            width: 75%;
            max-width: 75%;
            height: auto;
            object-fit: contain;
            display: block;
        }

        /* ==========================================================================
           5. HEADLINE & DYNAMIC IMAGE
           ========================================================================== */
        h1 {
            margin: 0;
            font-size: 1.6rem;
            font-weight: 800;
            line-height: 1.25;
            letter-spacing: -0.025em;
            background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
            word-break: break-word;
        }
        .hero-image {
            display: block;
            max-width: 100%;
            height: auto;
            border-radius: 14px;
            padding: 5px;
            background: rgba(0, 0, 0, 0.4);
            margin: 1.3rem auto;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 
                0 14px 30px rgba(0, 0, 0, 0.5),
                0 4px 10px rgba(0, 0, 0, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }

        /* ==========================================================================
           6. PRIMARY ACTION BUTTON
           - z-index -2 (.button::before): Blurred gradient underglow layer.
           - z-index -1 (.button::after): Opaque gradient surface and inset borders.
           - z-index  0 (.button-shimmer): Clipped container for shimmer animation.
           ========================================================================== */
        .button {
            position: relative;
            isolation: isolate;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            color: #ffffff;
            padding: 17px 24px;
            text-decoration: none;
            border-radius: 14px;
            font-size: 1.25rem;
            font-weight: 800;
            letter-spacing: 0.025em;
            text-transform: uppercase;
            margin-top: 1.3rem;
            user-select: none;
            touch-action: manipulation;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            transition: transform 0.1s ease, filter 0.1s ease;
            text-align: center;
        }
        .button-content {
            position: relative;
            z-index: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.55rem;
            line-height: 1.2;
        }
        .button-symbol {
            width: 1.25em;
            height: 1.25em;
            min-width: 1.25em;
            min-height: 1.25em;
            flex-shrink: 0;
            display: inline-block;
            vertical-align: middle;
            object-fit: contain;
            filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
        }

        .button::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: linear-gradient(135deg, var(--btn-start) 0%, var(--btn-end) 100%);
            z-index: -2;
            pointer-events: none;
            transform: translateY(3.24px);
            filter: blur(4.86px);
            opacity: 0.45;
            animation: pulse-glow 5s infinite ease-in-out;
        }

        .button::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: linear-gradient(135deg, var(--btn-start) 0%, var(--btn-end) 100%);
            box-shadow: 
                inset 0 1px 0 rgba(255, 255, 255, 0.45),
                inset 0 -2px 0 rgba(0, 0, 0, 0.22);
            z-index: -1;
            pointer-events: none;
        }

        @keyframes pulse-glow {
            0%, 100% {
                transform: translateY(3.24px);
                filter: blur(4.86px);
                opacity: 0.45;
            }
            50% {
                transform: translateY(4.32px);
                filter: blur(7.56px);
                opacity: 0.75;
            }
        }

        .button-shimmer {
            position: absolute;
            inset: 0;
            border-radius: inherit;
            overflow: hidden;
            pointer-events: none;
            z-index: 0;
        }
        .button-shimmer::after {
            content: "";
            position: absolute;
            top: 0;
            left: -120%;
            width: 60%;
            height: 100%;
            background: linear-gradient(
                90deg,
                transparent,
                rgba(255, 255, 255, 0.32),
                transparent
            );
            transform: skewX(-25deg);
            animation: shimmer 10.5s infinite;
        }
        @keyframes shimmer {
            0% { left: -120%; }
            11.67%, 100% { left: 150%; }
        }

        .button:active {
            transform: scale(0.97);
            filter: brightness(0.93);
        }

        /* ==========================================================================
           7. FOOTER
           ========================================================================== */
        .footer {
            margin-top: 1.85rem;
            padding-top: 1.3rem;
            border-top: 2px dashed rgba(255, 255, 255, 0.11);
            text-align: center;
            font-size: 0.75rem;
            color: #94a3b8;
            line-height: 1.45;
        }
        .footer-title {
            font-weight: 700;
            margin: 0 0 0.3rem 0;
            color: #cbd5e1;
            letter-spacing: 0.06em;
        }
        .footer-states {
            margin: 0 0 0.5rem 0;
        }
        .footer-disclaimer {
            margin: 0;
            font-weight: 700;
            color: #e2e8f0;
        }

        /* ==========================================================================
           8. DEVELOPER INTERFACE, URL BUILDER & DOCS MODAL (?dev=true)
           ========================================================================== */
        .dev-container {
            position: fixed;
            bottom: 1.25rem;
            left: 1.25rem;
            bottom: max(1.25rem, env(safe-area-inset-bottom));
            left: max(1.25rem, env(safe-area-inset-left));
            z-index: 1000;
            display: none;
        }
        .dev-container.visible {
            display: block;
        }
        .hamburger-btn {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: rgba(15, 23, 42, 0.92);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
            color: #f8fafc;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            touch-action: manipulation;
            transition: transform 0.15s ease, background 0.15s ease;
        }
        .hamburger-btn:active {
            transform: scale(0.94);
        }
        .hamburger-btn svg {
            width: 22px;
            height: 22px;
            stroke: currentColor;
            stroke-width: 2.2;
            stroke-linecap: round;
        }
        .dev-panel {
            position: absolute;
            bottom: 58px;
            left: 0;
            width: min(320px, calc(100vw - 2.5rem));
            max-height: calc(100dvh - 5.5rem);
            overflow-y: auto;
            background: rgba(15, 23, 42, 0.96);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 16px;
            padding: 1rem 1.1rem;
            box-shadow: 0 18px 38px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
            opacity: 0;
            pointer-events: none;
            transform: translateY(10px) scale(0.96);
            transform-origin: bottom left;
            transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .dev-panel.open {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0) scale(1);
        }
        .dev-panel-title {
            margin: 0 0 0.85rem 0;
            font-size: 0.85rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #f8fafc;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 0.5rem;
        }
        .builder-field {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
            margin-bottom: 0.7rem;
        }
        .builder-label {
            font-size: 0.74rem;
            font-weight: 700;
            color: #cbd5e1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .builder-label-param {
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: 0.68rem;
            font-weight: 500;
            color: #64748b;
        }
        .builder-input {
            width: 100%;
            background: rgba(9, 13, 24, 0.75);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 8px;
            padding: 0.48rem 0.6rem;
            color: #f8fafc;
            font-family: inherit;
            font-size: 0.78rem;
            outline: none;
            transition: border-color 0.15s ease;
        }
        .builder-input:focus {
            border-color: #60a5fa;
        }
        .builder-input::placeholder {
            color: #475569;
        }
        .picker-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.6rem;
            margin-top: 0.2rem;
            margin-bottom: 0.85rem;
            padding-top: 0.65rem;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        .picker-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(9, 13, 24, 0.55);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 0.4rem 0.55rem;
        }
        .picker-info {
            display: flex;
            flex-direction: column;
            gap: 0.12rem;
        }
        .picker-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: #cbd5e1;
        }
        .picker-hex {
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: 0.68rem;
            color: #94a3b8;
        }
        .color-input {
            -webkit-appearance: none;
            appearance: none;
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 8px;
            background: none;
            cursor: pointer;
            padding: 0;
            flex-shrink: 0;
        }
        .color-input::-webkit-color-swatch-wrapper {
            padding: 0;
        }
        .color-input::-webkit-color-swatch {
            border: 2px solid rgba(255, 255, 255, 0.25);
            border-radius: 8px;
        }
        .color-input::-moz-color-swatch {
            border: 2px solid rgba(255, 255, 255, 0.25);
            border-radius: 8px;
        }
        .builder-output {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 0.7rem;
        }
        .builder-output-label {
            display: block;
            font-size: 0.7rem;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #94a3b8;
            margin-bottom: 0.35rem;
        }
        .builder-url-link {
            display: block;
            background: rgba(9, 13, 24, 0.85);
            border: 1px solid rgba(96, 165, 250, 0.3);
            border-radius: 8px;
            padding: 0.5rem 0.6rem;
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: 0.7rem;
            line-height: 1.4;
            color: #60a5fa;
            text-decoration: underline;
            word-break: break-all;
            max-height: 4.8rem;
            overflow-y: auto;
        }
        .docs-btn {
            width: 100%;
            margin-top: 0.75rem;
            padding: 0.55rem 0.75rem;
            border-radius: 8px;
            background: rgba(59, 130, 246, 0.14);
            border: 1px solid rgba(96, 165, 250, 0.35);
            color: #93c5fd;
            font-family: inherit;
            font-size: 0.74rem;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            cursor: pointer;
            touch-action: manipulation;
            transition: transform 0.1s ease, background 0.15s ease;
        }
        .docs-btn:active {
            transform: scale(0.97);
            background: rgba(59, 130, 246, 0.24);
        }

        /* Documentation Viewer Modal */
        .docs-modal {
            position: fixed;
            inset: 0;
            z-index: 2000;
            background: rgba(2, 6, 23, 0.78);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.25rem;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }
        .docs-modal.open {
            opacity: 1;
            pointer-events: auto;
        }
        .docs-modal-card {
            width: 100%;
            max-width: 720px;
            max-height: 85dvh;
            background: rgba(15, 23, 42, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 18px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.65);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .docs-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.9rem 1.15rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(9, 13, 24, 0.6);
        }
        .docs-modal-title {
            font-size: 0.82rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #f8fafc;
        }
        .docs-close-btn {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #cbd5e1;
            width: 30px;
            height: 30px;
            border-radius: 8px;
            font-size: 1.1rem;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            touch-action: manipulation;
        }
        .docs-close-btn:active {
            transform: scale(0.93);
        }
        .docs-viewer {
            margin: 0;
            padding: 1.1rem 1.15rem;
            overflow-y: auto;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 0.72rem;
            line-height: 1.5;
            color: #cbd5e1;
            white-space: pre-wrap;
            word-break: break-word;
            text-align: left;
        }

        /* ==========================================================================
           10. IOS / MOBILE RESPONSIVENESS & TOUCH ENHANCEMENTS
           ========================================================================== */
        @media (max-width: 768px) {
            .builder-input {
                font-size: 16px; /* Prevents iOS WebKit automatic focus zoom */
            }
        }
