        /* Chrome-specific font rendering fixes - targets only Chrome/Chromium browsers */
        @supports (-webkit-mask: none) and (not (-webkit-backdrop-filter: blur(1px))) {
            /* This targets Chrome specifically, excluding Safari */
            
            * {
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
                text-rendering: optimizeLegibility;
            }
            
            body {
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
                font-weight: 400;
                font-synthesis: none;
            }
            
            /* Fix Chrome's tendency to make fonts too bold */
            label,
            .section-title,
            .notification-title,
            .mode-option .notification-title {
                font-weight: 500 !important; /* Use 500 instead of bold for better Chrome rendering */
            }
            
            .page-header h1 {
                font-weight: 700 !important;
                font-synthesis: none;
            }
            
            .page-header .subtitle {
                font-weight: 400 !important;
                font-synthesis: none;
            }
            
            button {
                font-family: inherit;
                font-weight: 500 !important;
                text-rendering: optimizeLegibility;
                -webkit-font-smoothing: antialiased;
            }
            
            input, select, textarea {
                font-family: inherit;
                font-weight: 400 !important;
                -webkit-font-smoothing: antialiased;
                text-rendering: optimizeLegibility;
            }
            
            .notification-title,
            .mode-option .notification-title {
                font-weight: 500 !important;
                -webkit-font-smoothing: antialiased;
            }
            
            .notification-description,
            .mode-option .notification-description {
                font-weight: 400 !important;
                -webkit-font-smoothing: antialiased;
            }
            
            .share-title {
                font-weight: 500 !important;
            }
        }

        /* Additional Chrome-only fix using user agent detection */
        @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
            /* This is another Chrome-specific selector */
            
            body {
                -webkit-font-smoothing: antialiased;
            }
            
            label {
                font-weight: 500;
            }
            
            button {
                font-weight: 500;
            }
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            line-height: 1.6;
            background: var(--canvas);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
            background: var(--surface);
            border-radius: 20px;
            box-shadow: 0 20px 60px color-mix(in srgb, var(--ink) 8%, transparent);
            overflow: hidden;
        }

        /* Sleeker, smaller header with navy-to-green gradient */
        .page-header {
            background: var(--brand);
            color: var(--surface);
            padding: 20px 32px 16px;
            margin: 0;
            position: relative;
            overflow: hidden;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 20px 20px 0 0;
        }

        .page-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-repeat: repeat;
            background-size: 200px 100px;
        }

        .page-header .header-content {
            text-align: center;
            z-index: 2;
            position: relative;
        }

        .page-header h1 {
            font-size: 22px;
            font-weight: 600;
            margin: 0 0 4px 0;
            text-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 30%, transparent);
            letter-spacing: -0.01em;
        }

        .page-header .subtitle {
            font-size: 14px;
            opacity: 0.9;
            font-weight: 400;
            text-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 20%, transparent);
        }

        /* Form section */
        .form-section {
            padding: 32px;
            background-color: var(--surface);
        }

        .section-title {
            color: var(--brand);
            font-size: 24px;
            font-weight: bold;
            margin: 0 0 20px 0;
            padding-bottom: 10px;
            border-bottom: 3px solid var(--brand);
            display: inline-block;
        }

        /* Numbered section cards. The form is still one form and one submit - these just
           break it into four things a host can think about one at a time, each with a line
           saying why it matters. */
        .form-step {
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 24px;
            background: var(--canvas);
        }

        .step-heading {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 6px;
        }

        .step-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--brand);
            color: var(--surface);
            font-size: 14px;
            font-weight: 700;
            flex-shrink: 0;
        }

        .step-title {
            font-size: 19px;
            font-weight: 600;
            color: var(--ink);
            margin: 0;
        }

        /* Shown when this form was filled in from a game the host already played. */
        .repeat-notice {
            margin: 0 0 20px;
            padding: 14px 18px;
            border: 1px solid var(--brand);
            border-left: 4px solid var(--brand);
            border-radius: 12px;
            background: var(--brand-soft);
            color: var(--ink);
            font-size: 14px;
            line-height: 1.5;
        }

        .repeat-notice[hidden] {
            display: none;
        }

#locationSelect {
            width: 100%;
            padding: 14px;
            border: 2px solid var(--border);
            border-radius: 10px;
            font-size: 16px;
            font-family: inherit;
            background: var(--surface);
            color: var(--ink);
        }

        .form-group {
            margin-bottom: 24px;
        }

        .court-image-panel {
            margin-top: 6px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: var(--canvas);
        }

        .court-image-panel[hidden] {
            display: none;
        }

        .court-image-heading {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        .court-image-title {
            color: var(--ink);
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 0.025em;
        }

        .court-image-intro {
            margin: 2px 0 0;
            color: var(--text-muted);
            font-size: 12px;
            line-height: 1.4;
        }

        .court-image-count {
            flex-shrink: 0;
            min-height: 22px;
            padding: 2px 8px;
            border-radius: 999px;
            background: var(--border);
            color: var(--ink);
            font-size: 11px;
            font-weight: 600;
        }

        .court-image-count:empty {
            display: none;
        }

        .court-image-status {
            min-height: 18px;
            margin: 8px 0;
            color: var(--text-muted);
            font-size: 12px;
            line-height: 1.4;
        }

        .court-image-status.is-error {
            color: var(--danger);
        }

        .court-image-gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(108px, 132px));
            gap: 10px;
            align-items: start;
        }

        .court-image-choice {
            position: relative;
            display: block;
            width: 100%;
            aspect-ratio: 4 / 3;
            margin: 0;
            overflow: hidden;
            border: 2px solid var(--border);
            border-radius: 10px;
            background: var(--surface);
            cursor: pointer;
            letter-spacing: 0;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
        }

        .court-image-choice:hover {
            border-color: var(--brand);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 14%, transparent);
        }

        .court-image-choice:has(input:checked) {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
        }

        .court-image-choice input[type="radio"] {
            position: absolute;
            z-index: 2;
            top: 7px;
            left: 7px;
            width: 18px;
            height: 18px;
            margin: 0;
            padding: 0;
            border: 0;
            accent-color: var(--brand);
            cursor: pointer;
        }

        .court-image-choice img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--ink);
            font-size: 14px;
            letter-spacing: 0.025em;
        }

        input, select, textarea {
            width: 100%;
            padding: 14px 16px;
            box-sizing: border-box;
            border: 2px solid var(--border);
            border-radius: 12px;
            font-size: 16px;
            transition: all 0.2s ease;
            background-color: var(--surface);
            font-family: inherit;
        }

        input[type="date"], input[type="time"] {
            width: 100% !important;
            -webkit-appearance: none;
            -moz-appearance: textfield;
        }

        input[type="time"] {
            min-height: 44px;
            line-height: 1.5;
            text-align: left;
            font-family: inherit;
        }

        input[type="time"]::-webkit-datetime-edit {
            width: 100%;
            display: flex;
            justify-content: left;
            align-items: left;
        }

        input:focus, select:focus, textarea:focus {
            border-color: var(--brand);
            outline: none;
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
            transform: translateY(-1px);
        }

        .form-help-text {
            color: var(--text-muted);
            font-size: 12px;
            margin-top: 6px;
            line-height: 1.4;
        }

        button {
            background: var(--brand);
            color: var(--surface);
            padding: 16px 28px;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            width: 100%;
            transition: all 0.3s ease;
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
            margin-top: 20px;
            position: relative;
            overflow: hidden;
        }

        button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: var(--surface);
            transition: left 0.5s;
        }

        button:hover {
            background: var(--brand);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px color-mix(in srgb, var(--brand) 40%, transparent);
        }

        button:hover::before {
            left: 100%;
        }

        button:active {
            transform: translateY(0);
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
        }

        /* SMS consent note. It is a disclosure, not a warning: nothing has gone wrong and
           there is nothing to fix, so it reads as quiet fine print rather than an alert. */
        .sms-info {
    background: var(--canvas);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

        /* Checkbox styling */
        .checkbox-inline {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--canvas);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-inline:hover {
    border-color: var(--border);
    background: var(--canvas);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 5%, transparent);
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--brand);
}

.checkbox-inline label {
    margin: 0;
    font-weight: 400;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    color: var(--ink);
    line-height: 1.4;
}

        /* Status messages */
        #status {
            margin: 20px 32px;
            padding: 14px 18px;
            border-radius: 10px;
            font-weight: 500;
            font-size: 14px;
        }

        .create-loading-overlay {
            align-items: center;
            background: color-mix(in srgb, var(--canvas) 92%, transparent);
            backdrop-filter: blur(5px);
            display: flex;
            inset: 0;
            justify-content: center;
            padding: 24px;
            position: fixed;
            z-index: 1000;
        }

        .create-loading-card {
            background: var(--surface);
            border: 1px solid var(--brand-border);
            border-radius: 18px;
            box-shadow: var(--shadow);
            max-width: 360px;
            padding: 32px 28px;
            text-align: center;
            width: 100%;
        }

        .create-loading-card h2 {
            color: var(--brand);
            font-size: 22px;
            margin: 20px 0 8px;
        }

        .create-loading-card p {
            color: var(--text-muted);
            margin: 0;
        }

        .success {
            background: var(--brand-soft);
            border: 1px solid var(--brand);
            color: var(--brand);
        }

        .error {
            background: var(--danger-soft);
            border: 1px solid var(--danger);
            color: var(--danger);
        }

        .info {
            background: var(--brand-soft);
            border: 1px solid var(--brand);
            color: var(--brand);
        }

        .warning {
            background: var(--warning-soft);
            border: 1px solid var(--warning);
            color: var(--warning);
        }

        /* Share section styling */
        .share-section {
            padding: 32px;
            background: var(--canvas);
            border-top: 1px solid var(--border);
        }

        .share-title {
            color: var(--ink);
            font-size: 22px;
            font-weight: 700;
            margin: 0 0 20px 0;
            text-align: center;
        }

        .save-suggestion {
            font-style: italic;
            color: var(--text-muted);
            margin-top: 10px;
            font-size: 14px;
        }

        .center-copy-section {
            text-align: center;
            padding: 16px 0;
        }

        .center-copy-section p {
            color: var(--text-muted);
            margin: 14px 0;
            font-size: 14px;
            line-height: 1.5;
        }

        .save-suggestion {
            font-style: italic;
            color: var(--text-muted);
            margin-top: 15px;
            font-size: 14px;
        }

        /* Updated CSS for the copy button */
        .copy-btn {
            background: var(--brand);
            color: var(--surface);
            padding: 14px 20px;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            width: 100%;
            max-width: 260px;
            margin: 16px auto;
            transition: all 0.3s ease;
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
            display: block;
        }

        .copy-btn:hover {
            background: var(--brand);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 40%, transparent);
        }

        .copy-btn:active {
            transform: translateY(0);
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
        }

        /* REPLACE your notifications CSS - MOVE this OUTSIDE the @media query and BEFORE the @media (max-width: 768px) section */

        /* UPDATE your notifications section CSS: */

        /* REPLACE your notifications section CSS with this: */

        .notifications-section {
            margin-top: 40px;
            margin-bottom: 30px;
            /* REMOVED: padding, background, border, box-shadow */
        }

        .notifications-section > label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: var(--ink); /* CHANGED: Match other form labels */
            font-size: 16px; /* CHANGED: Match other form labels */
        }

        .notifications-section small {
            color: var(--text-muted);
            font-size: 12px;
            margin-top: 5px;
            margin-bottom: 20px;
            display: block;
        }

        /* Modern Toggle-Style Checkboxes */
        .notification-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 20px;
            margin-bottom: 10px;
            background: var(--surface);
            border-radius: 12px;
            border: 2px solid var(--border);
            transition: all 0.3s ease;
            cursor: pointer;
            box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 5%, transparent);
        }

        .notification-option:hover {
            border-color: var(--brand);
            transform: translateY(-1px);
            box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 10%, transparent);
        }

        .notification-option.checked {
            border-color: var(--brand);
            background: var(--brand-soft);
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 15%, transparent);
        }

        .notification-content {
            display: flex;
            align-items: center;
            gap: 14px;
            flex: 1;
        }

        .notification-icon {
            font-size: 18px;
            width: 22px;
            text-align: center;
        }

        .notification-text {
            flex: 1;
        }

        .notification-title {
            font-weight: 600;
            font-size: 14px;
            color: var(--ink);
            margin: 0 0 3px 0;
            line-height: 1.3;
        }

        .notification-description {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        .notification-option.checked .notification-title {
            color: var(--brand);
        }

        .notification-option.checked .notification-description {
            color: var(--ink);
        }

        /* Custom Toggle Switch */
        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
            background-color: var(--border);
            border-radius: 12px;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

        .toggle-switch::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background-color: var(--surface);
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 10%, transparent);
        }

        .notification-option.checked .toggle-switch {
            background-color: var(--brand);
        }

        .notification-option.checked .toggle-switch::before {
            transform: translateX(20px);
        }

        /* Hide the actual checkbox */
        .notification-option input[type="checkbox"] {
            display: none;
        }

        /* Better button spacing */
        .notifications-section + button {
            margin-top: 40px;
        }

        /* MAKE REGISTRATION MODE LOOK LIKE NOTIFICATION TOGGLES */
        /* REPLACE your .mode-selector CSS with this: */

        .mode-selector {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
            margin-top: 10px;
        }

        .mode-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 20px;
            margin-bottom: 0;
            background: var(--surface);
            border-radius: 12px;
            border: 2px solid var(--border);
            transition: all 0.3s ease;
            cursor: pointer;
            box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 5%, transparent);
        }

        .mode-option:hover {
            border-color: var(--brand);
            transform: translateY(-1px);
            box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 10%, transparent);
        }

        .mode-option.checked {
            border-color: var(--brand);
            background: var(--brand-soft);
            box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 15%, transparent);
        }

        /* Hide the radio buttons */
        .mode-option input[type="radio"] {
            display: none;
        }

        /* Mode options use the same structure as notifications */
        .mode-option .notification-content {
            display: flex;
            align-items: center;
            gap: 14px;
            flex: 1;
        }

        .mode-option .notification-icon {
            font-size: 18px;
            width: 22px;
            text-align: center;
        }

        .mode-option .notification-text {
            flex: 1;
        }

        .mode-option .notification-title {
            font-weight: 600;
            font-size: 14px;
            color: var(--ink);
            margin: 0 0 3px 0;
            line-height: 1.3;
        }

        .mode-option .notification-description {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        /* Toggle switch styling for mode options */
        .mode-option .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
            background-color: var(--border);
            border-radius: 12px;
            transition: background-color 0.3s ease;
            cursor: pointer;
        }

        .mode-option .toggle-switch::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background-color: var(--surface);
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 10%, transparent);
        }

        .mode-option.checked .toggle-switch {
            background-color: var(--brand);
        }

        .mode-option.checked .toggle-switch::before {
            transform: translateX(20px);
        }

        .mode-option.checked .notification-title {
            color: var(--brand);
        }

        .mode-option.checked .notification-description {
            color: var(--ink);
        }

        @media (max-width: 768px) {
            body {
                padding: 10px;
                margin: 0;
            }

            .container {
                border-radius: 16px;
                box-shadow: none;
            }

            .page-header {
                min-height: 60px;
                padding: 16px 20px 12px;
                border-radius: 16px 16px 0 0;
            }

            .page-header h1 {
                font-size: 20px;
            }

            .page-header .subtitle {
                font-size: 13px;
            }

            .form-section, .share-section {
                padding: 20px;
            }

            .section-title {
                font-size: 20px;
            }

            input, select, textarea {
                padding: 12px 14px;
            }

            button {
                padding: 14px 20px;
                font-size: 15px;
            }

            .copy-btn {
                width: 100%;
                margin-top: 10px;
            }

            .notification-option, .mode-option {
                padding: 14px 16px;
            }

            .court-image-gallery {
                grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
            }

            /* Extra small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
    }

    .page-header {
        border-radius: 0;
    }
}

            /* ADD this CSS to your existing <style> section for better spacing */
        }
