:root {
    color-scheme: light;
    --primary-color: #087685;
    --primary-color-hover: #065d68;
    --primary-color-soft: #dff5f7;
    --primary-color-bright: #19c3d1;
    --secondary-color: #b4235a;
    --background-color: #101820;
    --header-to-body-bg: #f3f5f7;
    --dark-text-color: #17212b;
    --muted-text-color: #52606d;
    --light-text-color: #ffffff;
    --card-bg: #ffffff;
    --surface-muted: #eef2f5;
    --surface-accent: #e7f7f8;
    --border-color: #d7e0e6;
    --main-action-color: #087685;
    --main-action-selected-color: #065d68;
    --success-color: #1f7a38;
    --warning-color: #9a6700;
    --danger-color: #b4233b;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
    --duration-fast: 140ms;
    --duration-normal: 220ms;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --type-xs: 0.75rem;
    --type-sm: 0.875rem;
    --type-body: 1rem;
    --type-h3: clamp(1.15rem, 2vw, 1.35rem);
    --type-h2: clamp(1.5rem, 3vw, 2rem);
    --type-h1: clamp(2rem, 4vw, 3rem);
    --gma-gold: #FFD700;
    --gma-gold-light: #ffd700;
    --gma-gold-dark: #d4af37;
    --gma-gold-shine: #f8e473;
}

/* Roboto Font Faces */

/* Orbitron Font Face */

.tagline {
    display: block;
    margin-top: 0.65rem;
    font-size: 1.05rem;
    font-weight: 400;
    color: #e2e8f0;
    letter-spacing: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--header-to-body-bg);
    color: var(--dark-text-color);
    scroll-behavior: smooth;
}

main {
    max-width: 1200px;
    margin: 1.35rem auto 3rem;
    padding: 0 1rem;
}

/* Header Styles */
header {
    background: var(--background-color);
    color: var(--light-text-color);
    text-align: center;
    padding: clamp(0.95rem, 2vw, 1.2rem) 0 clamp(1.05rem, 2.2vw, 1.35rem);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3); /* Adds depth */
}

.main-logo-image {
    filter: invert(100%);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    flex-shrink: 0;
}

.header-link {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-link > .main-logo-image {
    width: clamp(72px, 8vw, 88px);
    height: auto;
    margin-bottom: 0.55rem;
}

.bannertext {
    text-align: center; /* Optional */
    box-sizing: border-box;
    font-size: 2.25rem;
    line-height: 1.08;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0;
    position: relative;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35);
    max-width: 100%;
    padding: 0 1rem;
}

h1 {
    text-align: center; /* Optional */
    font-size: 2.7rem;
    font-weight: 700;
    letter-spacing: 0;
    position: relative;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    padding: 0 1rem;
}

h2 {
    font-size: 2.3em;
    text-align: center; /* Optional */
    word-wrap: break-word; /* Optional, ensures words don't overflow */
}

@media (max-width: 768px) {
    h1 {
        font-size: 8vw;
    }

    h2 {
        font-size: 7vw;
    }
}

.join-game {
    text-decoration: none;
    margin-top: 1rem;
    padding: 0.75rem 1.65rem;
    font-size: 1.15rem;
    line-height: 1;
    background: var(--main-action-color);
    color: var(--light-text-color);
    border: none;
    border-radius: 150px;
    cursor: pointer;
    transition: background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Subtle shadow */
    animation: none;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.join-game-middle {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    font-size: 0.68em;
    font-weight: 400;
    position: relative;
    top: -1px;
}

.join-game::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -100px;
    left: -1000px;
    right: -1000px;
    background: transparent;
    pointer-events: all;
}

.scrolled-button::before {
    content: '';
    position: absolute;
    top: -30px;
    bottom: -30px;
    left: -30px;
    right: -30px;
    background: transparent;
    pointer-events: all;
}

.join-game:hover {
    background: var(--main-action-selected-color);
    transform: scale(1.04) rotate(1deg); /* Slight enlarge and tilt effect */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.26), 0 0 16px rgba(72, 187, 120, 0.45); /* Enhanced shadow and glow */
    transition: transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

.scrolled-button {
    position: fixed;
    top: 7px;
    bottom: auto;
    right: 24px;
    transform: none;
    z-index: 1000;
    margin-top: 0;
    min-height: 44px;
    padding: 0.55rem 1rem;
    box-sizing: border-box;
    font-size: 1rem;
    background: var(--main-action-color);
    transition: transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

    .scrolled-button:hover {
        background: var(--main-action-selected-color);
        transform: scale(1.04);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.26), 0 0 16px rgba(72, 187, 120, 0.45); /* Enhanced shadow and glow */
        transition: transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
    }

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 4px rgba(179, 229, 252, 0.65), 0 0 10px rgba(179, 229, 252, 0.45), 0 0 16px rgba(207, 216, 220, 0.36);
    }

    50% {
        box-shadow: 0 0 10px rgba(207, 216, 220, 0.5), 0 0 18px rgba(179, 229, 252, 0.5), 0 0 26px rgba(179, 229, 252, 0.36);
    }
}

.header-link {
    text-decoration: none;
    color: inherit; /* Inherit the color from the parent element */
}

    .header-link h1 {
        margin: 0; /* Retain the existing margin styles */
    }

.illustration {
    width: 95%;
    height: auto;
    max-width: 400px;
    display: block;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--dark-text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
}

/* Button Styles */
.options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
    width: 100%; /* Make the container fill the form width */
}

.option-button {
    padding: 1rem 2rem;
    margin: 0.5rem 0;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color, #3498db), #4fa3e8); /* Subtle gradient */
    color: var(--light-text-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
    width: 80%;
    max-width: 400px;
    min-height: 60px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center; /* Vertically center the text */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Soft shadow */
}

    .option-button:hover {
        background: linear-gradient(135deg, #4fa3e8, #5eb2f2); /* Brightened gradient */
        transform: scale(1.03); /* Slight enlarge effect */
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
    }

    .option-button:focus-visible {
        outline: 3px solid rgba(0, 188, 212, 0.78);
        outline-offset: 4px;
        box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.82), 0 6px 12px rgba(0, 0, 0, 0.18);
    }

    /* Specific styles for different buttons */
    .option-button.grey {
        border: 1px solid var(--lwc-border, var(--border-color));
        background: var(--lwc-surface-muted, var(--surface-muted));
        color: var(--lwc-ink, var(--dark-text-color));
    }

        /* Hover effects for specific buttons */
        .option-button.grey:hover {
            background: var(--lwc-surface, var(--card-bg));
        }

    .option-button.green {
        background: var(--main-action-color);
    }

        .option-button.green:hover {
            background: var(--main-action-selected-color);
        }

button.option-button:disabled {
    background: var(--lwc-surface-muted, #eef2f7) !important;
    border: 1px solid var(--lwc-border, rgba(100, 116, 139, 0.16));
    color: var(--lwc-muted, #526373);
    opacity: 1;
    /* Prevent all pointer events */
    pointer-events: none;
    cursor: not-allowed;
    /* Remove depth cues */
    box-shadow: none !important;
    transform: none;
    /* Disable text selection */
    user-select: none;
}

    button.option-button:disabled:hover {
        background: var(--lwc-surface-muted, #eef2f7) !important;
        border-color: var(--lwc-border, rgba(100, 116, 139, 0.16));
        color: var(--lwc-muted, #526373);
        box-shadow: none !important;
        transform: none;
    }

/* Adjust the back button styling */
.back-button {
    background: var(--lwc-surface-muted, #F5F5F5);
    color: var(--lwc-ink, #526373);
    border: 1px solid var(--lwc-border, #d7e0e6);
    box-shadow: none;
    transition: background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
    min-width: 100px; /* Match "Next" button width */
    min-height: 44px;
    height: auto;
    font-size: 1rem; /* Adjust font size for consistency */
    padding: 0.5rem 1.5rem;
    border-radius: var(--lwc-radius-md, 8px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem; /* Add spacing from "Next" button */
    margin-left: auto; /* Align to the left of the container */
}

    .back-button:hover {
        background: var(--lwc-surface, #ECEFF1);
        box-shadow: none;
        transform: none;
    }

.close {
    color: rgba(0, 0, 0, 0.7);
    font-size: 1.8rem;
    font-weight: bold;
    background: none;
    border: none;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Ensure no padding distorts shape */
    border-radius: 50%; /* Ensures circular shape */
    cursor: pointer;
    transition: color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

    .close:hover,
    .close:focus {
        color: #e74c3c; /* Brighter red for visibility on hover */
        transform: scale(1.1); /* Subtle zoom */
    }

.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    /* top and scroll position are handled by JavaScript for iOS compatibility */
}

.smaller-text {
    font-size: 0.85em;
    overflow-wrap: anywhere;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#custom-alert,
#loading-dialog {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#custom-alert[hidden],
#loading-dialog[hidden] {
    display: none;
}

.custom-alert-panel {
    border: none;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: calc(100dvh - 1.5rem);
    overflow: auto;
    background: var(--card-bg);
    color: var(--dark-text-color);
    text-align: center;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeInDialog var(--lwc-duration-normal, 220ms) var(--lwc-ease, ease);
}

    #custom-alert p {
        margin-bottom: 1rem;
        font-size: 1rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-align: left;
    }

    #custom-alert button {
        display: block;
        margin: 0 auto;
        padding: 0.7rem 1.5rem;
        min-height: 44px;
        font-size: 1rem;
        background: var(--main-action-color);
        color: var(--light-text-color);
        border: none;
        border-radius: 25px;
        cursor: pointer;
        transition: background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

        #custom-alert button:hover {
            background: var(--main-action-selected-color);
            transform: scale(1.05);
        }

@keyframes fadeInDialog {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .custom-alert-panel {
        width: calc(100% - 2rem);
    }
}

#biomarker-checklist .biomarker-item {
    display: flex;
    align-items: center;
    min-height: 32px;
    gap: 0.55rem;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--lwc-ink, #0f172a);
    font-weight: normal;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

#biomarker-checklist .biomarker-item:hover {
    background: var(--lwc-accent-soft, rgba(0, 188, 212, 0.08));
}

#biomarker-checklist .biomarker-checkbox {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color, #00bcd4);
}

#biomarker-checklist .biomarker-checkbox:focus-visible {
    outline: 3px solid rgba(0, 188, 212, 0.22);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    #biomarker-checklist .biomarker-item {
        min-height: 36px;
        padding: 0.3rem 0.45rem;
    }
}

/* LOADING DIALOG */
.loading-dialog-panel {
    border: none;
    border-radius: 15px;
    padding: 2rem;
    max-width: 200px;
    max-height: calc(100dvh - 1.5rem);
    background: var(--card-bg);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    animation: fadeInDialog var(--lwc-duration-normal, 220ms) var(--lwc-ease, ease);
}

.loader {
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sticky header bar (phoenix + title) when main header scrolls out of view */
.site-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--background-color);
    color: var(--light-text-color);
    padding: 0.25rem 1rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: opacity var(--lwc-duration-normal, 220ms) var(--lwc-ease, ease), transform var(--lwc-duration-normal, 220ms) var(--lwc-ease, ease);
}
.site-sticky-header.visible {
    display: flex;
}
.site-sticky-header.visible::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
    z-index: -1;
}
.site-sticky-header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 0.25rem;
    box-sizing: border-box;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}
.site-sticky-header-logo {
    width: 32px;
    height: 32px;
}
.site-sticky-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: capitalize;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
@media (prefers-reduced-motion: reduce) {
    .site-sticky-header {
        transition: none;
    }
}

@media (max-width: 768px) {
    main {
        margin-top: 1.2rem;
    }

    header {
        padding: 1.05rem 0 1.25rem;
    }

    .header-link > .main-logo-image {
        width: 76px;
        margin-bottom: 0.55rem;
    }

    .bannertext {
        font-size: 2.35rem;
        letter-spacing: 0;
        max-width: calc(100vw - 1.5rem);
        padding-inline: 0.5rem;
    }

    .join-game {
        margin-top: 1rem;
        padding: 0.78rem 1.55rem;
        max-width: calc(100vw - 3rem);
    }

    .scrolled-button {
        top: max(0.35rem, env(safe-area-inset-top, 0px));
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        min-width: 4.25rem;
        padding: 0.55rem 0.85rem;
        font-size: 0.95rem;
        z-index: 1001;
    }

    .site-sticky-header {
        justify-content: flex-start;
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: calc(max(0.5rem, env(safe-area-inset-right, 0px)) + 5.25rem);
    }

    header:not(:has(.join-game.scrolled-button)) + .site-sticky-header,
    header:has(.join-game.scrolled-button[style*="display: none"]) + .site-sticky-header {
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .site-sticky-header-link {
        max-width: 100%;
    }

    .site-sticky-header-title {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 360px) {
    .site-sticky-header-link {
        gap: 0.35rem;
    }

    .site-sticky-header-title {
        font-size: 0.88rem;
        letter-spacing: 0;
    }
}

@media (max-width: 300px) {
    .scrolled-button {
        right: max(0.45rem, env(safe-area-inset-right, 0px));
        min-width: 3.55rem;
        padding: 0.5rem 0.65rem;
        font-size: 0.86rem;
    }

    .site-sticky-header {
        padding-right: calc(max(0.45rem, env(safe-area-inset-right, 0px)) + 4.05rem);
    }

    .site-sticky-header-link {
        gap: 0.24rem;
    }

    .site-sticky-header-logo {
        display: none;
    }

    .site-sticky-header-title {
        font-size: 0.8rem;
        letter-spacing: 0;
    }
}

@media (max-width: 600px) {
    .bannertext {
        font-size: 2rem;
        letter-spacing: 0;
        max-width: calc(100vw - 1.25rem);
    }

    .tagline {
        font-size: 0.96rem;
    }

    .join-game {
        padding-inline: 1.45rem;
    }
}

@media (max-width: 420px) and (max-height: 820px) {
    header {
        padding-top: 1.05rem;
        padding-bottom: 1.35rem;
    }

    .header-link > .main-logo-image {
        width: 86px;
        margin-bottom: 0.7rem;
    }

    .bannertext {
        font-size: 1.9rem;
        line-height: 1.05;
        max-width: calc(100vw - 1.25rem);
    }

    .tagline {
        margin-top: 0.5rem;
        font-size: 0.95rem;
    }

    .join-game {
        margin-top: 0.9rem;
        padding: 0.75rem 1.45rem;
        font-size: 1.08rem;
    }
}

/* Shared visual system: compact competition chrome, calm surfaces, and stable controls. */
:root {
    /* Legacy pages referenced a magenta secondary accent decoratively. The
       shared system deliberately collapses it into the single teal accent. */
    --secondary-color: var(--primary-color);
    --lwc-play-action: #1f6f35;
    --lwc-play-action-highlight: #2e7d32;
    --lwc-play-action-hover: #185b2b;
    --lwc-play-action-hover-highlight: #256b31;
}

body {
    background: var(--header-to-body-bg);
    color: var(--dark-text-color);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

main {
    width: min(100%, 1232px);
    margin: var(--space-6) auto var(--space-7);
    padding-inline: var(--space-5);
}

h1,
h2,
h3 {
    color: var(--dark-text-color);
    line-height: 1.15;
    text-shadow: none;
    text-wrap: balance;
}

h1 {
    margin-block: var(--space-5) var(--space-6);
    padding: 0;
    font-size: var(--type-h1);
}

h2 {
    font-size: var(--type-h2);
}

h3 {
    font-size: var(--type-h3);
}

header[role="banner"] {
    min-height: 72px;
    padding: max(var(--space-3), env(safe-area-inset-top, 0px)) max(var(--space-5), env(safe-area-inset-right, 0px)) var(--space-3) max(var(--space-5), env(safe-area-inset-left, 0px));
    flex-direction: row;
    justify-content: center;
    gap: var(--space-4);
    background: var(--background-color);
    box-shadow: var(--shadow-sm);
}

header[role="banner"] .header-link {
    min-width: 0;
    min-height: 44px;
    flex-direction: row;
    gap: var(--space-3);
    border-radius: var(--radius-md);
}

header[role="banner"] .header-link:hover,
.site-sticky-header-link:hover {
    color: inherit;
}

header[role="banner"] .header-link > .main-logo-image {
    width: 44px;
    height: 44px;
    margin: 0;
    flex: 0 0 auto;
}

header[role="banner"] .bannertext {
    padding: 0;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.1;
    text-shadow: none;
    white-space: nowrap;
}

header[role="banner"] .tagline {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
}

.join-game,
.scrolled-button {
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--lwc-play-action) linear-gradient(135deg, var(--lwc-play-action) 0%, var(--lwc-play-action-highlight) 100%);
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(2, 12, 18, 0.28), 0 0 16px rgba(72, 187, 120, 0.3);
    animation: play-invitation calc(var(--lwc-duration-normal, 220ms) * 4) var(--lwc-ease, ease) 3;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    isolation: isolate;
    transition: background var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), border-color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), box-shadow var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

.join-game > strong,
.scrolled-button > strong {
    font-weight: 700;
}

.join-game:not(.scrolled-button) {
    position: absolute;
    right: max(var(--space-5), env(safe-area-inset-right, 0px));
}

.scrolled-button {
    top: max(var(--space-1), env(safe-area-inset-top, 0px));
}

.join-game::before,
.scrolled-button::before {
    content: '';
    position: absolute;
    inset: -5px;
    display: block;
    border: 1px solid rgba(104, 196, 125, 0.48);
    border-radius: calc(var(--radius-md) + var(--space-1));
    background: transparent;
    opacity: 0.8;
    pointer-events: none;
}

.scrolled-button::before {
    inset: calc(var(--space-1) / -2);
    border-radius: calc(var(--radius-md) + (var(--space-1) / 2));
}

.join-game:hover,
.scrolled-button:hover {
    background: var(--lwc-play-action-hover) linear-gradient(135deg, var(--lwc-play-action-hover) 0%, var(--lwc-play-action-hover-highlight) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 9px 18px rgba(2, 12, 18, 0.34), 0 0 24px rgba(72, 187, 120, 0.52);
    transform: translateY(-2px) scale(1.025);
}

.join-game:not(.scrolled-button):hover {
    transform: translateY(-2px) scale(1.025) rotate(1deg);
}

.join-game:active,
.scrolled-button:active {
    background: var(--lwc-play-action) linear-gradient(135deg, var(--lwc-play-action) 0%, var(--lwc-play-action-highlight) 100%);
    box-shadow: 0 3px 8px rgba(2, 12, 18, 0.28), 0 0 12px rgba(72, 187, 120, 0.28);
    transform: translateY(0) scale(0.985);
}

@keyframes play-invitation {
    0%,
    100% {
        box-shadow: 0 5px 12px rgba(2, 12, 18, 0.28), 0 0 16px rgba(72, 187, 120, 0.3);
    }

    50% {
        box-shadow: 0 7px 16px rgba(2, 12, 18, 0.32), 0 0 28px rgba(72, 187, 120, 0.58);
    }
}

@media (prefers-reduced-motion: reduce) {
    .join-game,
    .scrolled-button {
        animation: none;
        transition: none;
    }
}

.option-button,
.back-button,
#custom-alert button {
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: background-color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), border-color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), color var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease), transform var(--lwc-duration-fast, 140ms) var(--lwc-ease, ease);
}

.option-button {
    background: var(--primary-color);
    color: var(--light-text-color);
}

.option-button:hover,
.option-button.green:hover,
#custom-alert button:hover {
    background: var(--primary-color-hover);
    box-shadow: none;
    transform: translateY(-1px);
}

.option-button.green,
#custom-alert button {
    background: var(--main-action-color);
}

.option-button.grey,
.back-button {
    background: var(--lwc-surface-muted, var(--surface-muted));
    color: var(--lwc-ink, #405261);
    border: 1px solid var(--lwc-border, var(--border-color));
}

.option-button.grey:hover,
.back-button:hover {
    background: var(--lwc-surface, var(--card-bg));
    color: var(--lwc-ink, #273946);
    box-shadow: none;
    transform: none;
}

/* Keep forward progress in the Play flow visually distinct from the site's
   teal navigation accent. The green class is already the flow's semantic
   marker for the contextual primary action. */
body.play-flow-route {
    --play-flow-action-color: #1f7a38;
    --play-flow-action-hover-color: #17612d;
}

body.play-flow-route .option-button.green:not(:disabled):not([aria-disabled="true"]) {
    border-color: transparent;
    background: var(--play-flow-action-color);
    color: #ffffff;
}

body.play-flow-route .option-button.green:not(:disabled):not([aria-disabled="true"]):hover {
    background: var(--play-flow-action-hover-color);
}

/* Content imagery follows the same quiet boundary treatment as other media.
   This deliberately neutralizes the legacy poster-style frame above. */
.illustration {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.custom-alert-panel,
.loading-dialog-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

#custom-alert,
#loading-dialog {
    background: rgba(11, 15, 20, 0.66);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#biomarker-checklist .biomarker-item {
    min-height: 44px;
    border-radius: var(--radius-md);
}

#biomarker-checklist .biomarker-item:hover {
    background: var(--primary-color-soft);
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color-bright);
    outline-offset: 3px;
}

@media (max-width: 932px) {
    header[role="banner"] .tagline {
        display: none;
    }
}

@media (max-width: 640px) {
    main {
        margin-top: var(--space-5);
        padding-inline: max(var(--space-4), env(safe-area-inset-left, 0px));
    }

    header[role="banner"] {
        min-height: 64px;
        padding: max(var(--space-2), env(safe-area-inset-top, 0px)) max(var(--space-3), env(safe-area-inset-right, 0px)) var(--space-2) max(var(--space-3), env(safe-area-inset-left, 0px));
        justify-content: flex-start;
    }

    header[role="banner"] .header-link {
        max-width: calc(100% - 4.75rem);
        gap: var(--space-2);
    }

    header[role="banner"] .header-link > .main-logo-image {
        width: 36px;
        height: 36px;
    }

    header[role="banner"] .bannertext {
        max-width: none;
        padding: 0;
        font-size: clamp(1rem, 4.7vw, 1.2rem);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .join-game-middle,
    .join-game-end {
        display: none;
    }

    .join-game:not(.scrolled-button) {
        display: inline-flex;
        right: max(var(--space-3), env(safe-area-inset-right, 0px));
        padding-inline: var(--space-3);
    }
}

/* Mid-width phones have room for the complete brand/action pair. Keep the
   smallest layout below this threshold abbreviated so neither can collide. */
@media (min-width: 440px) and (max-width: 640px) {
    header[role="banner"] .header-link > .main-logo-image {
        width: 44px;
        height: 44px;
    }

    header[role="banner"] .join-game:not(.scrolled-button) .join-game-middle,
    header[role="banner"] .join-game:not(.scrolled-button) .join-game-end {
        display: inline-block;
    }
}

/* The homepage is the competition's front door, so its primary action keeps
   the full hero hierarchy. Task and documentation routes retain the compact
   shared header above. */
:where(body.home-page) header[role="banner"] {
    box-sizing: border-box;
    min-height: clamp(220px, 26vw, 280px);
    padding: clamp(var(--space-5), 3vw, var(--space-6));
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
    background: linear-gradient(120deg, #0b1117 0%, #2d3942 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

:where(body.home-page) header[role="banner"] .header-link {
    max-width: calc(100% - 2rem);
    min-height: 0;
    flex: 0 1 auto;
    flex-direction: column;
    gap: var(--space-1);
}

:where(body.home-page) header[role="banner"] .header-link > .main-logo-image {
    width: clamp(72px, 8vw, 88px);
    height: auto;
    margin: 0 0 var(--space-2);
    object-fit: contain;
}

:where(body.home-page) header[role="banner"] .bannertext {
    max-width: 100%;
    padding: 0;
    overflow: visible;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
    text-overflow: clip;
    white-space: nowrap;
}

:where(body.home-page) header[role="banner"] .join-game:not(.scrolled-button) {
    position: relative;
    right: auto;
    display: inline-flex;
    min-height: 52px;
    max-width: calc(100% - 2rem);
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    letter-spacing: 0.025em;
}

:where(body.home-page) header[role="banner"] .join-game:not(.scrolled-button)::before {
    border-radius: calc(var(--radius-lg) + var(--space-1));
}

:where(body.home-page) header[role="banner"] .join-game:not(.scrolled-button) .join-game-middle,
:where(body.home-page) header[role="banner"] .join-game:not(.scrolled-button) .join-game-end {
    display: inline-block;
}

@media (max-width: 640px) and (min-height: 481px) {
    :where(body.home-page) header[role="banner"] {
        min-height: 240px;
        padding: var(--space-4);
    }

    :where(body.home-page) header[role="banner"] .header-link > .main-logo-image {
        width: 72px;
        height: auto;
    }

    :where(body.home-page) header[role="banner"] .bannertext {
        font-size: clamp(1.75rem, 8vw, 2.15rem);
    }

}

@media (max-width: 932px) and (max-height: 480px) and (orientation: landscape) {
    header[role="banner"] {
        min-height: 72px;
        padding: max(var(--space-2), env(safe-area-inset-top, 0px)) max(var(--space-3), env(safe-area-inset-right, 0px)) var(--space-2) max(var(--space-3), env(safe-area-inset-left, 0px));
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-3);
    }

    header[role="banner"] .header-link {
        max-width: none;
        min-width: 0;
        min-height: 44px;
        flex: 1 1 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-2);
    }

    header[role="banner"] .header-link > .main-logo-image {
        width: 44px;
        height: auto;
        margin: 0;
    }

    header[role="banner"] .bannertext {
        min-width: 0;
        overflow: hidden;
        font-size: clamp(1rem, 3vw, 1.3rem);
        line-height: 1.05;
        text-overflow: ellipsis;
    }

    header[role="banner"] .join-game:not(.scrolled-button) {
        position: static;
        right: auto;
        display: inline-flex;
        flex: 0 0 auto;
        min-height: 44px;
        max-width: none;
        padding: 0.65rem var(--space-3);
        font-size: 0.9rem;
        white-space: nowrap;
    }

}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --header-to-body-bg: #0d141b;
        --dark-text-color: #e6edf3;
        --muted-text-color: #aebdca;
        --card-bg: #17212b;
        --surface-muted: #202d38;
        --surface-accent: #18353c;
        --border-color: #42515e;
        --primary-color: #5bd5dd;
        --primary-color-hover: #8be6eb;
        --primary-color-soft: #173e44;
        --main-action-color: #087685;
        --main-action-selected-color: #0a6977;
        --success-color: #68c47d;
        --warning-color: #e9bd61;
        --danger-color: #ff8ba0;
    }

    body,
    main {
        background: var(--header-to-body-bg);
        color: var(--dark-text-color);
    }

    .option-button.grey,
    .back-button {
        background: var(--surface-muted);
        color: var(--dark-text-color);
        border-color: var(--border-color);
    }

    .custom-alert-panel,
    .loading-dialog-panel {
        background: var(--card-bg);
        color: var(--dark-text-color);
    }
}

@media (forced-colors: active) {
    a:focus-visible,
    button:focus-visible,
    [role="button"]:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 3px solid Highlight;
        outline-offset: 3px;
    }

    .join-game,
    .option-button {
        border: 1px solid ButtonText;
    }
}
/* Always reserve space so scrollIntoView/anchor links are not covered by the sticky bar (works on load and when sticky is visible) */
html {
    scroll-padding-top: 52px;
}
