/* Progressive enhancements for public portal tasks. */
:focus-visible { outline: 2px solid #ff9bc4; outline-offset: 4px; }
.skip-link { position: fixed; inset-block-start: .5rem; inset-inline-start: 1rem; z-index: 100; padding: .75rem 1rem; background: #121822; color: #fff; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
[data-auth-form] input:not([type=hidden]) { font-size: 1rem; min-height: 44px; }
[data-auth-errors], [data-auth-form], #main-content { overflow-wrap: anywhere; }
[data-auth-form] button:disabled { opacity: .65; cursor: wait; }
.password-toggle { color: #ff9bc4; font-size: .875rem; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.form-status { color: #fda4af; font-size: .875rem; line-height: 1.8; }
.form-status:empty { display: none; }
.copy-value { min-width: 0; overflow-wrap: anywhere; unicode-bidi: isolate; user-select: all; }
[data-copy] { min-height: 44px; flex-shrink: 0; }
.portal-feedback { position: fixed; inset-block-end: 1rem; inset-inline: 1rem; margin-inline: auto; max-width: 32rem; z-index: 60; color: #fff; background: #161d28; border-radius: 12px; font-size: .875rem; overflow-wrap: anywhere; }
.portal-feedback:not(:empty) { padding: 1rem; border: 1px solid #94a3b8; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
    .password-toggle, .portal-feedback, .skip-link { color: CanvasText; background: Canvas; border: 1px solid ButtonText; }
    :focus-visible { outline-color: Highlight; }
}

/* Reflow public journeys without hiding content or download variants. */
.portal-header > div:first-child, #main-content {
    padding-left: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-left));
    padding-right: max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-right));
}
.portal-header a, .portal-header button { min-height: 44px; }
.portal-header a { align-items: center; }
.portal-header a[href='/login'], .portal-header a[href='/register'] { display: inline-flex; }
.portal-header #mobile-menu-toggle { min-width: 44px; }
.portal-header #mobile-nav-drawer {
    max-height: calc(100vh - 4rem);
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
.portal-header input { font-size: 1rem; min-height: 44px; }
.portal-header .mobile-account-actions { display: none; }
.public-page { min-width: 0; }
.public-page h1 { text-wrap: balance; }
.public-page p { font-size: 1rem; line-height: 1.9; }
.public-page summary { min-height: 44px; }
.public-download #game-platform { font-size: 1rem; min-height: 48px; }
.public-download a[href^='/downloads/'] { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.public-download #game-packages > div { scroll-margin-top: 6rem; }
.public-home .score-main, .public-home .score-info, .public-home .player-name { min-width: 0; overflow-wrap: anywhere; }
.public-home .score-main { flex: 1; }
.public-home .score-main > div:first-child { flex-shrink: 0; }
.public-home .score-totals { flex-shrink: 0; }
.public-home .score-totals a { min-height: 44px; display: inline-flex; align-items: center; }
.portal-feedback { inset-block-end: max(1rem, env(safe-area-inset-bottom)); }
@media (max-width: 639px) {
    .portal-header [data-header-settings], .portal-header .header-logout, .portal-header .header-profile span { display: none; }
    .portal-header .header-profile { min-width: 44px; justify-content: center; padding-inline: .5rem; }
    .portal-header .mobile-account-actions { display: flex; }
    .public-page > .glass-card, .public-auth > div > .glass-card, .public-home .home-hero { padding: 1.25rem; }
    .public-page .glass-card h2 { overflow-wrap: anywhere; }
    .public-home .score-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .public-home .score-totals { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; border-top: 1px solid #263143; padding-top: .5rem; }
    .public-home .score-info > div:first-child { font-size: .875rem; line-height: 1.8; }
    .public-home .player-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .public-home .player-row > div:last-child { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-top: 1px solid #263143; padding-top: .5rem; }
    .public-home .player-row > div:first-child { min-width: 0; flex: 1; }
    .public-home .player-row > div:first-child > div { min-width: 0; }
}
@media (max-width: 480px) {
    .public-home .hero-actions { flex-direction: column; align-items: stretch; }
    .public-home .hero-actions a { justify-content: center; min-height: 48px; }
    .public-home .home-metrics > div { min-width: 0; padding: 1rem; }
    .public-home .home-metrics > div > div:first-child { display: none; }
    .public-home .home-metrics > div > div:last-child { min-width: 0; }
    .public-home .home-metrics .text-2xl { font-size: clamp(1rem, 5vw, 1.5rem); white-space: nowrap; }
    .public-page h1 { font-size: 1.875rem; line-height: 1.4; }
}
@media (max-width: 399px) {
    .portal-header .header-badge { display: none; }
}
@media (pointer: coarse) {
    .portal-header a, .portal-header button, .public-page button, .public-page summary { min-height: 48px; }
}
.client-guide { scroll-margin-top: 6rem; }
.client-guide summary:focus-visible { outline: 2px solid #ff9bc4; outline-offset: 4px; }

/* Shared finishing details, within the existing dark pink/purple palette. */
.public-page .portal-primary, .portal-header .portal-primary {
    background-image: linear-gradient(to right, #ad2067, #7024b4);
    color: #fff;
    min-height: 44px;
}
.public-page .portal-primary:hover, .portal-header .portal-primary:hover { filter: brightness(1.08); }
.public-page .text-slate-500, .portal-footer { color: #94a3b8; }
.public-auth input::placeholder { color: #94a3b8; opacity: 1; }
.public-page a, .public-page button, .portal-footer a { text-underline-offset: 4px; }
.public-page h1 bdi { white-space: nowrap; }
.public-page .text-slate-500 { font-size: .75rem; }
.public-auth label { font-size: .875rem; }
@media (forced-colors: active) {
    .public-page .portal-primary, .portal-header .portal-primary { color: ButtonText; background: ButtonFace; border: 1px solid ButtonText; }
}
.public-auth [data-auth-errors] > div { font-size: .875rem; line-height: 1.8; }
.public-auth input:focus-visible, .portal-header #mobile-menu-toggle:focus-visible { outline: 2px solid #ff9bc4; outline-offset: 3px; }
.portal-footer a:hover { color: #fff; text-decoration: underline; }
html { color-scheme: dark; scrollbar-color: #52637b #0b0f17; }
.public-auth input { caret-color: #ff9bc4; }
