:root {
    --lyutils-void: #0d1424;
    --lyutils-card-border: rgba(42, 138, 170, 0.4);
    --lyutils-card-fill-top: rgba(30, 50, 76, 0.9);
    --lyutils-card-fill-bottom: rgba(16, 28, 46, 0.94);
    --lyutils-ice: #8adcf4;
    --lyutils-cyan: #5ec8ea;
    --lyutils-logo: #6ba8ff;
    --lyutils-logo-hover: #93c0ff;
}

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

html {
    scrollbar-gutter: stable;
}

/* Shared visual preference: focus must not add an extra outline around controls.
   Keep the native focus state and tab order intact, including custom switches. */
:focus,
:focus-visible,
input:focus-visible + * {
    outline: none !important;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--lyutils-void);
    color: #e8e8e8;
}

/* Playwright capture runs in Docker with Liberation Sans, not Segoe UI. */
body.lyutils-capture {
    font-family: "Liberation Sans", "DejaVu Sans", sans-serif;
}

/* iOS Safari auto-links long numbers as phone numbers */
a[x-apple-data-detectors],
a[href^="tel:"] {
    color: inherit !important;
    text-decoration: none !important;
}

body:not(.lyutils-capture):not(.lyutils-welcome)::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--lyutils-void);
    background-image:
        radial-gradient(ellipse 80% 42% at 50% -8%, rgba(42, 138, 170, 0.18), transparent 62%),
        radial-gradient(ellipse 36% 28% at 108% 92%, rgba(42, 138, 170, 0.12), transparent 58%),
        radial-gradient(ellipse 32% 24% at -8% 78%, rgba(42, 138, 170, 0.08), transparent 55%),
        url("../images/home-void.d5cdde1fa924.svg");
    background-size: auto, auto, auto, 42rem 42rem;
    background-position: center, center, center, 0 0;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}

.lyutils-mark {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(107, 168, 255, 0.35);
}

.page-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.page-content--upper {
    align-items: flex-start;
    justify-content: center;
    padding-top: 3.25rem;
    padding-bottom: 2rem;
}

.account-background-sync {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;
    color: #a4c5de;
    font-size: 0.75rem;
    --sync-accent: #7abce7;
}
.account-background-sync[hidden] { display: none; }
.account-background-sync > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    list-style: none;
    transition: background 160ms, border-color 160ms;
}
.account-background-sync > summary::-webkit-details-marker { display: none; }
.account-background-sync > summary:hover,
.account-background-sync[open] > summary {
    background: rgba(120, 172, 210, 0.07);
    border-color: rgba(120, 172, 210, 0.16);
}
.account-background-sync > summary:focus-visible { outline: 2px solid #7abce7; outline-offset: 2px; }
.account-background-sync__label { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform: translateY(-1px); }
.account-background-sync__dot {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sync-accent);
}
.account-background-sync[data-state="running"] .account-background-sync__dot {
    animation: sync-status-pulse 2s ease-in-out infinite;
}
.account-background-sync[data-state="done"] { --sync-accent: #45cbb3; color: var(--lyutils-cyan); }
.account-background-sync[data-state="warning"] { --sync-accent: #d6b173; color: #d6c09b; }
.account-background-sync[data-state="error"] { --sync-accent: #df8e91; color: #dfb0b2; }
.account-background-sync__panel {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-height: min(70vh, 420px);
    overflow: auto;
    box-sizing: border-box;
    padding: 1rem;
    border: 1px solid rgba(131, 173, 207, 0.24);
    border-radius: 0.75rem;
    background: #101e2e;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    color: #d3deea;
    font-size: 0.8rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.account-background-sync__panel p { margin: 0; }
.account-background-sync__panel .account-background-sync__heading { margin-bottom: 0.5rem; font-weight: 600; color: #eef4fa; }
.account-background-sync__panel .account-background-sync__domains { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(131, 173, 207, 0.15); white-space: pre-line; color: #93a8bb; font-size: 0.72rem; }
@keyframes sync-status-pulse {
    0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 rgba(122, 188, 231, 0); }
    50% { opacity: 1; box-shadow: 0 0 0 4px rgba(122, 188, 231, 0.09); }
}
@media (prefers-reduced-motion: reduce) {
    .account-background-sync[data-state="running"] .account-background-sync__dot { animation: none; }
}
@media (max-width: 640px) {
    .account-background-sync > summary { padding-inline: 0.25rem; gap: 0.35rem; }
    .account-background-sync__label { max-width: 5.5rem; }
    .account-background-sync__panel { position: fixed; top: 62px; left: 12px; right: 12px; width: auto; }
}

@media (max-width: 640px) {
    .page-content {
        padding: 1rem 0.75rem;
    }

    .page-content--upper {
        padding-top: 1rem;
        padding-bottom: 1.25rem;
    }
}

.site-footer {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem 1.25rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    overflow: visible;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-footer > * {
    position: relative;
    z-index: 1;
}

.site-footer__disclaimer {
    color: #8a8a9a;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    min-width: 0;
    justify-self: center;
}

.site-footer__disclaimer:only-child {
    grid-column: 1 / -1;
}

.site-footer__social {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    justify-self: start;
}

.site-footer__discord-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.site-footer__discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a5b4fc;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.site-footer__discord:hover,
.site-footer__discord-menu--open .site-footer__discord {
    color: #c7d2fe;
    background: rgba(255, 255, 255, 0.08);
}

.site-footer__discord-dropdown {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 0;
    min-width: 15.5rem;
    max-width: min(18.5rem, calc(100vw - 2rem));
    padding: 0.375rem;
    background: linear-gradient(
        180deg,
        var(--lyutils-card-fill-top) 0%,
        var(--lyutils-card-fill-bottom) 100%
    );
    border: 1px solid var(--lyutils-card-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 80;
}

.site-footer__discord-menu--open .site-footer__discord-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-footer__discord-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #e8e8e8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    transition: background 0.15s;
}

.site-footer__discord-item:hover {
    background: rgba(94, 200, 234, 0.12);
}

.site-footer__discord-item:focus-visible {
    outline: 2px solid #8db6d8;
    outline-offset: -2px;
    background: rgba(94, 200, 234, 0.12);
}

.site-footer__donate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #f87171;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
    transition: color 0.2s;
}

.site-footer__donate:hover {
    color: #fca5a5;
}

.site-footer__donate:hover .donate-icon--footer {
    animation: donate-icon-wiggle 0.55s ease;
}

@media (min-width: 960px) {
    .site-footer__disclaimer {
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .site-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 0.45rem 0.75rem;
        padding:
            0.65rem
            max(0.75rem, env(safe-area-inset-right, 0px))
            max(0.65rem, env(safe-area-inset-bottom, 0px))
            max(0.75rem, env(safe-area-inset-left, 0px));
    }

    .site-footer__disclaimer {
        order: 1;
        grid-column: 1 / -1;
        text-align: center;
        font-size: 0.7rem;
        line-height: 1.35;
        white-space: normal;
    }

    .site-footer__social {
        order: 2;
        justify-self: start;
        gap: 0.65rem;
    }

    .site-footer__donate {
        order: 2;
        justify-self: end;
        font-size: 0.72rem;
    }
}

.donate-icon {
    display: block;
    flex-shrink: 0;
    color: currentColor;
}

.donate-icon--footer {
    width: 1.35rem;
    height: 1.35rem;
}

.discord-icon {
    display: block;
    flex-shrink: 0;
    color: currentColor;
}

.discord-icon--footer {
    width: 1.1rem;
    height: 1.1rem;
}

@keyframes donate-icon-wiggle {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(-10deg) translateY(-1px); }
    55% { transform: rotate(8deg) translateY(-2px); }
    75% { transform: rotate(-4deg) translateY(0); }
}

.site-footer p {
    color: #8a8a9a;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

.card,
.content-card {
    padding: 3rem 2.5rem;
    background: linear-gradient(
        180deg,
        var(--lyutils-card-fill-top) 0%,
        var(--lyutils-card-fill-bottom) 100%
    );
    border: 1px solid var(--lyutils-card-border);
    border-radius: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card {
    text-align: center;
    width: 90%;
}

.content-card {
    text-align: left;
    width: 100%;
    max-width: none;
    padding: 2rem 1.75rem;
}

/* Guide chapter tiles — in base.css so they render even if guide.css is missing/stale. */
.guide-chapter-card {
    width: 100%;
    max-width: none;
    text-align: left;
    padding: 2rem 1.75rem;
    background: linear-gradient(
        180deg,
        var(--lyutils-card-fill-top) 0%,
        var(--lyutils-card-fill-bottom) 100%
    );
    border: 1px solid var(--lyutils-card-border);
    border-radius: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.guide-chapter-card > .guide-chapter__title {
    text-align: center;
}

.info-icon-btn__svg {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
}

/* Disabled controls are unavailable, regardless of any loading/hover skin.
   Explicit busy states on enabled controls keep their page-specific cursor. */
:disabled,
[aria-disabled="true"],
:disabled *,
[aria-disabled="true"] * {
    cursor: not-allowed !important;
}

/* Native disabled buttons already block activation. Keep them hit-testable so
   the cursor and title belong to the button instead of the element beneath it.
   Do not enable pointer events for aria-disabled links or custom controls. */
button:disabled,
input:disabled {
    pointer-events: auto !important;
}
