/* ==========================================================================
   Main menu (title screen), rehecho 12-11-2026.

   The composition of a game menu rather than a web page: the column on the
   left (logo, the voyages, settings), the deck footage left open on the
   right, a card there that tells what the highlighted entry is, and one thin
   rail at the foot. Same materials as the rest of the game: gold leaf over
   sea, Cinzel for names, Spectral for words, the rolling sea rule.

   Loaded after theme.css. Only `.tx-*` classes and the shared title pieces
   (#titleScreen, .title-mark, .title-logo, .title-scrim) are styled here.
   ========================================================================== */

#titleScreen {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    column-gap: clamp(24px, 4vw, 72px);
    padding: clamp(18px, 4vh, 44px) clamp(22px, 5vw, 84px) 0;
    --logo-w: min(36vw, 520px, 70vh);
}

/* Shade where the type is (left and foot), the footage clear on the right. */
#titleScreen .title-scrim,
#titleScreen.has-video .title-scrim {
    background:
        radial-gradient(ellipse 60% 80% at 0% 45%, rgba(2, 8, 14, 0.80), transparent 70%),
        linear-gradient(90deg,
            rgba(3, 7, 12, 0.86) 0%,
            rgba(3, 7, 12, 0.62) 32%,
            rgba(3, 7, 12, 0.20) 62%,
            rgba(3, 7, 12, 0.10) 100%),
        linear-gradient(180deg,
            rgba(3, 7, 12, 0.55) 0%,
            transparent 22%,
            transparent 70%,
            rgba(3, 7, 12, 0.90) 100%);
}

/* --- The column ----------------------------------------------------------- */
.tx-col {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

#titleScreen .title-mark {
    margin: 0 0 calc(var(--logo-w) * 0.07) -1.5%;
}
#titleScreen .title-logo {
    width: var(--logo-w);
    aspect-ratio: 1400 / 452;
}
#titleScreen .title-reflection { opacity: 0.16; }

.tx-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(100%, 520px);
    margin: 0 0 8px 16px;
    font-family: var(--font-title);
    font-size: 0.72rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(244, 199, 94, 0.82);
    animation: titleIn 0.9s var(--ease-smooth) 0.55s both;
}
.tx-eyebrow::after {
    content: "";
    flex: 1;
    height: 12px;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent);
    mask-image: linear-gradient(90deg, #000 30%, transparent);
    animation: ruleRoll 30s linear infinite;
    opacity: 0.8;
}

.tx-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: min(100%, 520px);
}

/* --- One entry ------------------------------------------------------------ */
.tx-entry {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px 22px 14px 14px;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    animation: titleIn 0.8s var(--ease-smooth) both;
}
.tx-entry:nth-child(1) { animation-delay: 0.65s; }
.tx-entry:nth-child(2) { animation-delay: 0.75s; }
.tx-entry:nth-child(3) { animation-delay: 0.85s; }
.tx-entry:nth-child(4) { animation-delay: 0.95s; }
.tx-entry:focus { outline: none; }
.tx-entry:focus-visible .tx-num { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

/* The light that sits on the chosen entry: gold leaf from the left edge,
   a brass bar, and the sea rule rolling under it. */
.tx-entry::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-left: 3px solid var(--gold);
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(244, 199, 94, 0.24) 0%, rgba(244, 199, 94, 0.08) 48%, rgba(25, 184, 191, 0.04) 78%, transparent 100%);
    box-shadow: inset 12px 0 26px -18px rgba(255, 223, 140, 0.8);
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 0.28s ease, transform 0.36s var(--ease-smooth);
}
.tx-entry::after {
    content: "";
    position: absolute;
    left: 74px;
    right: 18%;
    bottom: 2px;
    height: 10px;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent);
    mask-image: linear-gradient(90deg, #000 40%, transparent);
    animation: ruleRoll 24s linear infinite;
    opacity: 0;
    transform: scaleX(0.6);
    transform-origin: left center;
    transition: opacity 0.3s ease, transform 0.5s var(--ease-smooth);
    pointer-events: none;
}
.tx-entry.is-selected::before { opacity: 1; transform: none; }
.tx-entry.is-selected::after { opacity: 0.9; transform: none; }

/* Roman numeral in a brass ring, like a dial on the helm. */
.tx-num {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(244, 199, 94, 0.34);
    box-shadow: inset 0 0 0 4px rgba(4, 12, 18, 0.55), inset 0 0 0 5px rgba(244, 199, 94, 0.14);
    font-family: var(--font-title);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(244, 199, 94, 0.78);
    background: rgba(4, 16, 24, 0.55);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.35s var(--ease-smooth);
}
.tx-entry.is-selected .tx-num {
    color: #2a1904;
    border-color: var(--gold-hi);
    background: radial-gradient(circle at 35% 30%, #fff3c4 0%, #f6cb63 45%, #c98a22 100%);
    box-shadow: inset 0 0 0 4px rgba(255, 244, 205, 0.25), 0 0 22px rgba(244, 199, 94, 0.45);
    transform: rotate(-8deg) scale(1.06);
}

.tx-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.tx-label {
    font-family: var(--font-title);
    font-size: clamp(1.05rem, 1.6vw, 1.42rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.15;
    color: #e6eeeb;
    transition: color 0.25s ease, letter-spacing 0.4s var(--ease-smooth);
}
/* The chosen name is lettered like the logo: gold above the waterline. */
.tx-entry.is-selected .tx-label {
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: 0.13em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 16px rgba(244, 199, 94, 0.25));
}

.tx-meta {
    font-family: var(--font-prose);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.35;
    color: rgba(207, 232, 228, 0.6);
    transition: color 0.25s ease;
}
.tx-entry.is-selected .tx-meta { color: rgba(236, 246, 243, 0.92); }

/* The hero entry: bigger name, and a seal that says where to begin. */
.tx-entry.is-hero { padding-block: 16px 18px; margin-top: 8px; }
.tx-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-entry.is-hero .tx-label { font-size: clamp(1.3rem, 2.1vw, 1.85rem); }
.tx-entry.is-hero .tx-num { width: 46px; height: 46px; font-size: 0.9rem; }

.tx-badge {
    position: absolute;
    top: -8px;
    right: 18px;
    padding: 4px 10px 3px;
    border: 1px solid rgba(244, 199, 94, 0.55);
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--gold);
    background: rgba(24, 16, 4, 0.92);
    box-shadow: 0 0 14px rgba(244, 199, 94, 0.18);
}
.tx-entry.is-selected .tx-badge { color: #2a1904; background: var(--gold); border-color: var(--gold-hi); }

/* Settings: not a voyage, so a quieter line under a hairline. */
.tx-entry.is-utility {
    grid-template-columns: 46px minmax(0, 1fr);
    margin-top: 12px;
    padding-block: 10px;
}
.tx-entry.is-utility::after { display: none; }
.tx-entry.is-utility { box-shadow: 0 -1px 0 rgba(244, 199, 94, 0.12); }
.tx-gear {
    justify-self: center;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: rgba(244, 199, 94, 0.75);
    stroke-width: 1.5;
    stroke-linecap: round;
    transition: transform 0.6s var(--ease-smooth), stroke 0.25s ease;
}
.tx-entry.is-utility.is-selected .tx-gear { transform: rotate(60deg); stroke: var(--gold-hi); }
.tx-entry.is-utility .tx-label {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: rgba(214, 228, 225, 0.72);
}
.tx-entry.is-utility.is-selected .tx-label {
    background: none;
    -webkit-text-fill-color: var(--gold-hi);
    color: var(--gold-hi);
    filter: none;
}

/* Nothing to continue: present, but asleep. */
.tx-entry:disabled { cursor: default; }
.tx-entry:disabled .tx-num { border-style: dashed; opacity: 0.55; }
.tx-entry:disabled .tx-label { color: rgba(214, 228, 225, 0.38); }
.tx-entry:disabled .tx-meta { color: rgba(207, 232, 228, 0.32); }
.tx-entry:disabled.is-selected::before { opacity: 0.35; }
.tx-entry:disabled.is-selected::after { opacity: 0; }
.tx-entry:disabled.is-selected .tx-num { color: rgba(244, 199, 94, 0.7); background: rgba(4, 16, 24, 0.55); box-shadow: none; transform: none; }
.tx-entry:disabled.is-selected .tx-label { background: none; -webkit-text-fill-color: rgba(214, 228, 225, 0.5); filter: none; }

#titleScreen.has-video .tx-label,
#titleScreen.has-video .tx-meta,
#titleScreen.has-video .tx-eyebrow { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 2px 12px rgba(0, 0, 0, 0.7); }
#titleScreen.has-video .tx-entry.is-selected .tx-label { text-shadow: none; }

/* --- The card on the right ------------------------------------------------ */
.tx-detail {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: end;
    position: relative;
    z-index: 4;
    width: min(400px, 100%);
    margin-bottom: clamp(16px, 5vh, 56px);
    padding: 24px 26px 22px;
    border: 1px solid rgba(244, 199, 94, 0.26);
    border-radius: 14px;
    background:
        linear-gradient(165deg, rgba(8, 36, 48, 0.86) 0%, rgba(3, 14, 21, 0.9) 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 241, 189, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: titleIn 1s var(--ease-smooth) 1.05s both;
}
/* A brass inlay just inside the edge, and a waterline along the top. */
.tx-detail::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(244, 199, 94, 0.1);
    border-radius: 9px;
    pointer-events: none;
}
.tx-detail::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    top: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--sea) 80%, transparent);
    box-shadow: 0 0 12px rgba(244, 199, 94, 0.5);
}
.tx-detail.is-swap > * { animation: txSwap 0.42s var(--ease-smooth) both; }
.tx-detail.is-swap > :nth-child(2) { animation-delay: 0.03s; }
.tx-detail.is-swap > :nth-child(3) { animation-delay: 0.06s; }
.tx-detail.is-swap > :nth-child(4) { animation-delay: 0.09s; }

.tx-detail-eyebrow {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--frost);
}
.tx-detail-title {
    margin: 6px 0 10px;
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.15;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7));
}
/* Lettered per line, so a name that wraps keeps gold over sea on each line. */
.tx-detail-title span {
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.tx-detail-text {
    margin: 0;
    font-family: var(--font-prose);
    font-size: 1rem;
    line-height: 1.55;
    color: #d6e4e1;
}
.tx-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
.tx-detail-tags:empty { display: none; }
.tx-detail-tags li {
    padding: 5px 11px 4px;
    border: 1px solid rgba(95, 224, 220, 0.3);
    border-radius: 999px;
    background: rgba(25, 184, 191, 0.08);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--frost);
}
.tx-detail[data-mode="story"] .tx-detail-tags li {
    border-color: rgba(244, 199, 94, 0.38);
    background: rgba(244, 199, 94, 0.08);
    color: var(--amber-soft);
}

@keyframes txSwap {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* --- The rail at the foot ------------------------------------------------- */
.tx-foot {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px 28px;
    flex-wrap: wrap;
    padding: 14px 0 16px;
    border-top: 1px solid rgba(244, 199, 94, 0.1);
    animation: titleIn 1s var(--ease-smooth) 1.15s both;
}
.tx-foot-left,
.tx-foot-right {
    display: flex;
    align-items: center;
    gap: 14px 20px;
    flex-wrap: wrap;
    min-width: 0;
}
.tx-foot p { margin: 0; }

#titleScreen .tx-byline {
    display: block;
    font-family: var(--font-title);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(214, 228, 225, 0.6);
}
#titleScreen .tx-byline::before,
#titleScreen .tx-byline::after { content: none; display: none; }
#titleScreen .tx-byline strong { color: var(--gold); font-weight: 700; }

.tx-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tx-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px 6px 10px;
    border: 1px solid rgba(244, 199, 94, 0.18);
    border-radius: 999px;
    background: rgba(4, 16, 24, 0.6);
    font-family: var(--font-ui);
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(226, 238, 235, 0.82);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.tx-link:hover,
.tx-link:focus-visible { border-color: var(--gold); color: var(--gold-hi); background: rgba(40, 26, 6, 0.5); outline: none; }
.tx-link-icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}
.tx-link.is-support { border-color: rgba(244, 199, 94, 0.42); color: var(--amber-soft); }
.tx-link.is-support .tx-link-icon { fill: rgba(244, 199, 94, 0.3); stroke: var(--gold); }

#titleScreen .tx-keys { font-size: 0.74rem; color: rgba(214, 228, 225, 0.55); }
.tx-adults {
    padding: 4px 10px 3px;
    border: 1px solid rgba(244, 199, 94, 0.3);
    border-radius: 4px;
    font-family: var(--font-title);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(244, 199, 94, 0.8);
}
#titleScreen .tx-version {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: rgba(214, 228, 225, 0.4);
}
#titleScreen .tx-version:empty { display: none; }

/* --- Short screens: tighten the column before anything leaves the frame --- */
@media (max-height: 720px) {
    #titleScreen { --logo-w: min(32vw, 460px, 62vh); }
    .tx-entry { padding-block: 8px 10px; }
    .tx-entry.is-hero { padding-block: 11px 13px; }
    .tx-meta { font-size: 0.86rem; }
    .tx-entry.is-utility { margin-top: 6px; padding-block: 7px; }
    .tx-foot { padding-block: 10px 12px; }
    .tx-detail { padding: 20px 22px 18px; }
    .tx-detail-text { font-size: 0.94rem; }
}
@media (max-height: 560px) and (min-width: 901px) {
    #titleScreen { --logo-w: min(28vw, 360px, 56vh); }
    .tx-eyebrow { display: none; }
    .tx-entry:not(.is-selected) .tx-meta { display: none; }
}

/* --- Narrow screens (phones, portrait tablets): one centred column -------- */
@media (max-width: 900px) {
    #titleScreen {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        padding: clamp(14px, 4vh, 36px) 16px 0;
        overflow-y: auto;
        --logo-w: min(84vw, 440px, 40vh);
    }
    #titleScreen .title-scrim,
    #titleScreen.has-video .title-scrim {
        background: linear-gradient(180deg,
            rgba(3, 7, 12, 0.70) 0%,
            rgba(3, 7, 12, 0.55) 30%,
            rgba(3, 7, 12, 0.72) 70%,
            rgba(3, 7, 12, 0.92) 100%);
    }
    .tx-col { align-items: center; width: 100%; max-width: 520px; justify-self: center; }
    #titleScreen .title-mark { margin-left: 0; }
    .tx-eyebrow { margin-left: 0; justify-content: center; }
    .tx-eyebrow::before {
        content: "";
        flex: 1;
        height: 12px;
        background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                    var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                    var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
        -webkit-mask-image: linear-gradient(270deg, #000 30%, transparent);
        mask-image: linear-gradient(270deg, #000 30%, transparent);
        animation: ruleRoll 30s linear infinite;
        opacity: 0.8;
    }
    .tx-detail { display: none; }
    .tx-entry { padding-right: 14px; gap: 12px; grid-template-columns: 40px minmax(0, 1fr); }
    .tx-entry.is-utility { grid-template-columns: 40px minmax(0, 1fr); }
    .tx-num { width: 38px; height: 38px; }
    .tx-entry.is-hero .tx-num { width: 40px; height: 40px; }
    .tx-entry::after { left: 66px; }
    .tx-foot { flex-direction: column; justify-content: center; gap: 10px; padding-block: 14px 18px; text-align: center; }
    .tx-foot-left, .tx-foot-right { justify-content: center; }
    .tx-keys { display: none; }
}
@media (max-width: 420px) {
    .tx-badge { display: none; }
    .tx-entry.is-hero .tx-label { font-size: 1.22rem; }
    .tx-label { font-size: 1.02rem; letter-spacing: 0.07em; }
    .tx-entry.is-selected .tx-label { letter-spacing: 0.09em; }
}

/* --- Motion settings ------------------------------------------------------ */
html[data-motion="reduced"] .tx-entry,
html[data-motion="none"] .tx-entry,
html[data-motion="none"] .tx-detail,
html[data-motion="none"] .tx-foot,
html[data-motion="none"] .tx-eyebrow,
html[data-motion="reduced"] .tx-detail.is-swap > *,
html[data-motion="none"] .tx-detail.is-swap > * { animation: none !important; }
html[data-motion="none"] .tx-eyebrow::after,
html[data-motion="none"] .tx-eyebrow::before,
html[data-motion="none"] .tx-entry::after { animation: none !important; }
html[data-motion="none"] .tx-entry::before,
html[data-motion="none"] .tx-num,
html[data-motion="none"] .tx-gear { transition: none; }
@media (prefers-reduced-motion: reduce) {
    .tx-entry, .tx-detail.is-swap > *, .tx-eyebrow::after, .tx-entry::after { animation: none !important; }
}
