/* Shared site chrome, typography, buttons, and utility UI. */

:root {
    --color-black: #000;
    --color-link: #0000ff;
    --color-link-hover: #0b63ce;
    --color-link-rgb: 0, 0, 255;
    --color-hint-pulse: var(--color-link);
    --color-hint-pulse-rgb: var(--color-link-rgb);
    --color-hint-pulse-border: #0000ff;
    --pulse-cycle-duration: 1.25s;
    --color-quest: #ff7f50;
    --color-quest-hover: #e56f43;
    --color-control-text: #18324b;
    --color-text: #36454f;
    --color-surface-white: #fff;
    --color-box-bg: #f8f9fa;
    --home-surface-max-width: 760px;
    --composer-control-width: 18rem;
    --sticky-header-height: 5.2rem;
    --sticky-header-gap: 0.45rem;
    --game-hud-top-offset: 0.45rem;
    --game-hud-height: 7rem;
}

html {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--color-text);
    margin: 1.25rem auto;
    padding: 0 1rem;
    max-width: 1400px;
    overflow-x: clip;
    min-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

a,
a:visited {
    color: var(--color-link);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.site-body {
    flex: 1 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.9rem;
    position: sticky;
    top: 0;
    z-index: 110;
    padding: 0.35rem 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(2px);
}

.site-logo-wrap {
    display: inline-block;
    line-height: 0;
}

.site-logo {
    display: block;
    width: min(150px, 25vw);
}

.home-shell {
    width: 100%;
}

.home-hero {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: none;
    border-radius: 0;
    background: transparent;
}

.home-hero.home-text-page {
    max-width: var(--home-surface-max-width, 760px);
    margin-left: auto;
    margin-right: auto;
}

.home-hero h1 {
    margin: 0;
}

.hero-subtitle {
    margin: 0 0 1rem;
    font-size: 1.06rem;
}

.nav-menu {
    position: relative;
    margin-left: auto;
}

.nav-menu-toggle {
    list-style: none;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    padding: 0.38rem 0.55rem;
    border-radius: 6px;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-text);
    transition:
        background 120ms ease,
        border-color 120ms ease;
}

.nav-menu-toggle::-webkit-details-marker,
.nav-menu-toggle::marker {
    display: none;
}

.nav-menu[open] .nav-menu-toggle,
.nav-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: #d6d6d6;
}

.nav-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 180px;
    background: var(--color-surface-white);
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 0.3rem 0;
    z-index: 200;
}

.nav-menu-item {
    display: block;
    padding: 0.6rem 1.1rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu-item:visited {
    color: var(--color-text);
}

.nav-menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-link);
    text-decoration: none;
}

.nav-menu-divider {
    border: none;
    border-top: 1px solid #ececec;
    margin: 0.3rem 0;
}

.settings-menu {
    position: relative;
}

.settings-menu summary {
    list-style: none;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    text-decoration: none;
    color: var(--color-link);
}

.settings-menu summary:hover {
    color: var(--color-link-hover);
}

.settings-menu summary::-webkit-details-marker {
    display: none;
}

.settings-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    width: 180px;
    background: var(--color-box-bg);
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 0.55rem 0.65rem;
    z-index: 100;
}

.settings-dropdown p {
    margin: 0 0 0.35rem;
}

.settings-dropdown p:last-child {
    margin-bottom: 0;
}

.start-run-actions {
    display: flex;
    justify-content: center;
}

.start-run-play-wrap {
    position: relative;
}

form.is-submitting button[type="submit"] {
    cursor: progress;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: min(90vw, 520px);
    padding: 0.7rem 0.9rem;
    border: 1px solid #d2a300;
    border-radius: 6px;
    background: #fff8d8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 999;
}
@media (max-width: 640px) {
    .site-logo {
        width: min(170px, 50vw);
    }

    .home-hero {
        padding: 0.8rem;
    }

}
