/*
|--------------------------------------------------------------------------
| Wayfarer Play Shell v20
|--------------------------------------------------------------------------
*/

html,
body {
    height: 100%;
}


body.wayfarer-play-page {
    margin: 0;
    overflow: hidden;
    background: #eef1f5;
    color: #20242a;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.45;
}


.wayfarer-play-page * {
    box-sizing: border-box;
}


.wayfarer-play-page hr {
    display: none;
}


.wayfarer-play-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.wayfarer-play-shell-header {
    flex: 0 0 auto;
    min-height: 68px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #ffffff;
    border-bottom: 1px solid #d8dbe2;
}


.wayfarer-play-title {
    min-width: 0;
}


.wayfarer-play-title h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}


.wayfarer-play-title p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 0.9rem;
}


.wayfarer-shell-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.wayfarer-shell-button {
    border: 1px solid #b8bdc7;
    border-radius: 6px;
    padding: 7px 10px;
    background: #ffffff;
    color: #20242a;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}


.wayfarer-shell-button:hover {
    background: #f6f7f9;
}


.wayfarer-play-main {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns:
        minmax(0, 7fr)
        minmax(330px, 3fr);
    gap: 12px;
    padding: 12px;
    overflow: hidden;
}


.wayfarer-player-pane,
.wayfarer-author-pane {
    min-width: 0;
    min-height: 0;
    background: #ffffff;
    border: 1px solid #d8dbe2;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}


.wayfarer-player-pane {
    overflow: auto;
    padding: 22px;
}


.wayfarer-player-pane > h2:first-child {
    margin-top: 0;
}


#wayfarer-player-scene {
    margin-top: 10px;
}


#wayfarer-player-scene h2 {
    margin-top: 0;
}


.wayfarer-author-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.wayfarer-author-header {
    flex: 0 0 auto;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e3e6eb;
}


.wayfarer-author-header h2 {
    margin: 0;
    font-size: 1.05rem;
}


.wayfarer-author-header p {
    margin: 6px 0 0;
    font-size: 0.85rem;
}


.wayfarer-author-header a {
    color: #2f5ea8;
}


.wayfarer-author-toolbar {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: #f6f7f9;
    border-bottom: 1px solid #e3e6eb;
}


.wayfarer-author-toolbar #wayfarer-tick-test {
    margin: 0;
}


.wayfarer-author-toolbar #wayfarer-tick-test > h2 {
    margin: 0 0 6px;
    font-size: 0.9rem;
}


.wayfarer-author-toolbar #wayfarer-tick-test > p {
    margin: 5px 0;
    font-size: 0.82rem;
}


.wayfarer-author-toolbar button {
    margin-right: 4px;
    margin-bottom: 2px;
    padding: 5px 8px;
}


#wayfarer-tick-message {
    min-height: 1.2em;
}


.wayfarer-author-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
    padding: 8px 10px 0;
    background: #ffffff;
    border-bottom: 1px solid #d8dbe2;
}


.wayfarer-author-tab {
    appearance: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 10px 7px;
    background: transparent;
    color: #667085;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
}


.wayfarer-author-tab:hover {
    color: #20242a;
}


.wayfarer-author-tab.is-active {
    color: #2f5ea8;
    border-bottom-color: #2f5ea8;
}


.wayfarer-author-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 18px;
}


.wayfarer-author-tab-panel {
    display: none;
}


.wayfarer-author-tab-panel.is-active {
    display: block;
}


.wayfarer-author-tab-panel > :first-child {
    margin-top: 0;
}


.wayfarer-author-tab-panel h3 {
    margin-top: 0;
    font-size: 1rem;
}


.wayfarer-author-tab-panel h4 {
    margin-bottom: 8px;
}


.wayfarer-author-tab-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}


.wayfarer-author-tab-panel th,
.wayfarer-author-tab-panel td {
    padding: 6px 7px;
    text-align: left;
    vertical-align: top;
}


.wayfarer-author-tab-panel pre {
    max-width: 100%;
    overflow: auto;
    font-size: 0.78rem;
}


#wayfarer-author-debug-panel details {
    margin-top: 0 !important;
}


#wayfarer-author-debug-panel summary {
    display: none;
}


#wayfarer-author-debug-panel details:not([open]) > *:not(summary) {
    display: block;
}


#wayfarer-author-debug-panel details > pre {
    display: block;
    max-height: none !important;
    margin-top: 0 !important;
}


.wayfarer-player-meta {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #f6f7f9;
    color: #667085;
    font-size: 0.86rem;
}


.wayfarer-player-meta h2 {
    margin: 0 0 4px;
    color: #20242a;
    font-size: 0.95rem;
}


.wayfarer-player-meta p {
    margin: 0;
}


.wayfarer-play-shell.author-collapsed .wayfarer-play-main {
    grid-template-columns: minmax(0, 1fr);
}


.wayfarer-play-shell.author-collapsed .wayfarer-author-pane {
    display: none;
}


@media (max-width: 900px) {

    body.wayfarer-play-page {
        overflow: auto;
    }

    .wayfarer-play-shell {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .wayfarer-play-main {
        display: block;
        overflow: visible;
        padding: 8px;
    }

    .wayfarer-player-pane,
    .wayfarer-author-pane {
        overflow: visible;
        margin-bottom: 10px;
    }

    .wayfarer-author-pane {
        min-height: 480px;
    }

    .wayfarer-author-content {
        overflow: visible;
    }

    .wayfarer-play-shell.author-collapsed .wayfarer-author-pane {
        display: none;
    }
}

/* ------------------------------------------------------------------
   GAME START SCREEN
   WAYFARER_PLAYER_START_SCREEN_V36
------------------------------------------------------------------ */

/*
 * WAYFARER_ROLE_BASED_AUTHOR_MODE_V37
 *
 * The start screen no longer implies "no Author Mode." Authors may inspect
 * the Author panel before initialization. The existing author-collapsed class
 * controls the one-column layout for normal players and collapsed authors.
 */

.wayfarer-start-screen {
    width: min(860px, 100%);
    margin: 0 auto;
}

.wayfarer-start-screen-heading { margin-bottom: 24px; }

.wayfarer-start-screen-heading h2 {
    margin: 0 0 12px;
    font-size: 1.65rem;
}

.wayfarer-start-introduction {
    max-width: 72ch;
    color: #4b5563;
    line-height: 1.65;
}

.wayfarer-start-error {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid #e4a7ad;
    border-radius: 7px;
    background: #fff4f5;
    color: #8b1e2d;
}

.wayfarer-start-form {
    display: grid;
    gap: 22px;
}

.wayfarer-start-section,
.wayfarer-start-choice {
    margin: 0;
    padding: 18px;
    border: 1px solid #d8dbe2;
    border-radius: 9px;
    background: #ffffff;
}

.wayfarer-start-section h3,
.wayfarer-start-choice legend {
    margin: 0 0 14px;
    color: #20242a;
    font-size: 1.05rem;
    font-weight: 700;
}

.wayfarer-start-choice legend { padding: 0 6px; }

.wayfarer-start-names {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.wayfarer-start-names label {
    display: grid;
    gap: 5px;
    font-weight: 600;
}

.wayfarer-start-names input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #b8bdc7;
    border-radius: 6px;
    font: inherit;
}

.wayfarer-start-choice {
    display: grid;
    gap: 10px;
}

.wayfarer-start-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px 13px;
    border: 1px solid #d8dbe2;
    border-radius: 7px;
    cursor: pointer;
}

.wayfarer-start-option:hover { background: #f6f7f9; }

.wayfarer-start-option input { margin-top: 4px; }

.wayfarer-start-option-copy {
    display: grid;
    gap: 4px;
}

.wayfarer-start-option-copy > span {
    color: #667085;
    font-size: 0.92rem;
}

.wayfarer-start-actions {
    display: flex;
    justify-content: flex-end;
}

.wayfarer-start-button {
    padding: 10px 18px;
    border: 1px solid #244b88;
    border-radius: 7px;
    background: #2f5ea8;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.wayfarer-start-button:hover { background: #244b88; }

@media (max-width: 700px) {
    .wayfarer-start-screen { width: 100%; }

    .wayfarer-start-section,
    .wayfarer-start-choice {
        padding: 14px;
    }
}


/* ------------------------------------------------------------------
   PLAYER ACTION SCREEN
   WAYFARER_ACTION_SCREEN_V39
------------------------------------------------------------------ */

.wayfarer-action-screen {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid #d8dbe2;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}


.wayfarer-action-screen[hidden],
.wayfarer-travel-controls[hidden] {
    display: none !important;
}


.wayfarer-action-heading {
    margin-bottom: 14px;
}


.wayfarer-action-heading h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}


.wayfarer-action-heading p {
    margin: 0;
    color: #667085;
}


.wayfarer-action-list {
    display: grid;
    gap: 10px;
}


.wayfarer-action-button {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #214b86;
    border-radius: 8px;
    background: #245a9b;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}


.wayfarer-action-button:hover {
    background: #1e4c84;
}


.wayfarer-action-button:disabled {
    cursor: default;
    opacity: 0.55;
}


/* ------------------------------------------------------------------
   IN-CARD ACTION UTILITY VIEWS
   WAYFARER_ACTION_UTILITY_VIEWS_V48
------------------------------------------------------------------ */

.wayfarer-action-utility-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
}


.wayfarer-action-utility-button,
.wayfarer-action-back-button {
    padding: 10px 12px;
    border: 1px solid #b8bdc7;
    border-radius: 7px;
    background: #ffffff;
    color: #20242a;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
}


.wayfarer-action-utility-button {
    width: 100%;
    text-align: center;
}


.wayfarer-action-utility-button:hover,
.wayfarer-action-back-button:hover {
    border-color: #98a2b3;
    background: #f6f7f9;
}


.wayfarer-action-subview[hidden],
.wayfarer-action-heading[hidden],
.wayfarer-action-list[hidden] {
    display: none !important;
}


.wayfarer-action-subview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}


.wayfarer-action-subview-heading h2 {
    margin: 0;
    font-size: 1.25rem;
}


.wayfarer-action-back-button {
    flex: 0 0 auto;
}


.wayfarer-action-subview-body {
    min-height: 90px;
}


/* ------------------------------------------------------------------
   ENTITY INVENTORY / STATUS PRESENTATION
   WAYFARER_ENTITY_PRESENTATION_V49
------------------------------------------------------------------ */

.wayfarer-inventory-list,
.wayfarer-party-list {
    display: grid;
    gap: 10px;
}


.wayfarer-inventory-item,
.wayfarer-party-member,
.wayfarer-status-section {
    padding: 13px 14px;
    border: 1px solid #d8dbe2;
    border-radius: 8px;
    background: #f8fafc;
}


.wayfarer-inventory-item-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}


.wayfarer-inventory-quantity {
    flex: 0 0 auto;
    color: #667085;
    font-size: 0.9rem;
    font-weight: 650;
}


.wayfarer-status-section + .wayfarer-status-section {
    margin-top: 12px;
}


.wayfarer-status-section > h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}


.wayfarer-status-player-name {
    margin: 0;
    font-weight: 700;
}


.wayfarer-party-member {
    background: #ffffff;
}


.wayfarer-party-member h4 {
    margin: 0;
    font-size: 0.98rem;
}


/* WAYFARER_PLAYER_TRAITS_STATUS_V52 */
.wayfarer-player-member h4::after {
    content: "Player";
    margin-left: 8px;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


.wayfarer-status-values {
    margin: 10px 0 0;
}


.wayfarer-status-values > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 6px 0;
    border-top: 1px solid #e3e6eb;
}


.wayfarer-status-values dt {
    color: #4b5563;
}


.wayfarer-status-values dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}


.wayfarer-status-muted {
    margin: 8px 0 0;
    color: #667085;
    font-size: 0.88rem;
}


/* ------------------------------------------------------------------
   ENTITY DETAIL VIEW
   WAYFARER_ENTITY_DETAIL_VIEW_V50
------------------------------------------------------------------ */

.wayfarer-entity-open-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #2f5ea8;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    text-align: left;
}


.wayfarer-entity-open-button:hover {
    text-decoration: underline;
}


.wayfarer-entity-open-button:focus-visible {
    outline: 2px solid #2f5ea8;
    outline-offset: 3px;
    border-radius: 2px;
}


.wayfarer-status-player-names {
    display: grid;
    gap: 4px;
}


.wayfarer-status-player-names .wayfarer-status-player-name {
    margin: 0;
}


.wayfarer-entity-detail-eyebrow {
    margin: 0 0 3px;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.wayfarer-entity-detail-layout {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}


.wayfarer-entity-detail-layout:not(:has(.wayfarer-entity-detail-media)) {
    grid-template-columns: minmax(0, 1fr);
}


.wayfarer-entity-detail-media {
    margin: 0;
}


.wayfarer-entity-detail-media img {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: 8px;
    background: #f6f7f9;
}


.wayfarer-entity-detail-description {
    margin: 0 0 16px;
    line-height: 1.6;
}


.wayfarer-entity-detail-copy > :first-child {
    margin-top: 0;
}


@media (max-width: 700px) {

    .wayfarer-entity-detail-layout {
        grid-template-columns: 1fr;
    }

    .wayfarer-entity-detail-media img {
        max-height: 280px;
    }
}


.wayfarer-action-empty {
    margin: 0;
    color: #667085;
    font-size: 0.92rem;
}


.wayfarer-travel-controls {
    margin-top: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d8dbe2;
    border-radius: 10px;
    background: #ffffff;
}


.wayfarer-travel-status {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}


/* WAYFARER_TRAVEL_TIME_HUD_V61 */
.wayfarer-travel-copy {
    min-width: 0;
}

.wayfarer-travel-primary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.wayfarer-travel-time {
    font-weight: 800;
}

.wayfarer-travel-time-separator {
    color: #98a2b3;
}

.wayfarer-travel-next {
    margin-top: 3px;
    color: #667085;
    font-size: 0.88rem;
    font-weight: 600;
}


.wayfarer-travel-indicator {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
}


.wayfarer-travel-pause {
    padding: 8px 12px;
    border: 1px solid #aab4c3;
    border-radius: 7px;
    background: #ffffff;
    color: #20242a;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}


.wayfarer-travel-pause:hover {
    background: #f6f7f9;
}


@media (max-width: 620px) {

    .wayfarer-action-screen {
        padding: 14px;
    }

    .wayfarer-travel-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .wayfarer-travel-pause {
        width: 100%;
    }

    .wayfarer-action-utility-row {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------
   LOCATION / STORY PRESENTATION
   WAYFARER_LOCATION_ARRIVAL_PRESENTATION_V40
------------------------------------------------------------------ */

/*
 * Scene prose now belongs to Presentation Mode rather than the normal Action
 * page. The server-rendered scene remains in the DOM temporarily for runtime
 * compatibility but is not player-facing.
 */
#wayfarer-player-scene {
    display: none;
}


.wayfarer-action-parent-context {
    margin-bottom: 4px !important;
    font-size: 0.85rem;
    font-weight: 600;
}



/* ------------------------------------------------------------------
   STORYLET ACTIONS / BRANCHES
   WAYFARER_STORYLET_ACTION_RUNTIME_V59
------------------------------------------------------------------ */

.wayfarer-storylet-action-list {
    display: grid;
    gap: 10px;
}

.wayfarer-storylet-action-list:empty {
    display: none;
}

.wayfarer-storylet-branch-list {
    width: 100%;
    display: grid;
    gap: 10px;
}

.wayfarer-presentation-actions.wayfarer-has-storylet-branches > div:not(.wayfarer-storylet-branch-list) {
    display: none;
}

.wayfarer-storylet-branch-prompt {
    margin: 0 0 4px;
    color: #b8c0cc;
    font-weight: 700;
}

.wayfarer-storylet-branch-button {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #f8fafc;
    border-radius: 8px;
    background: transparent;
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.wayfarer-storylet-branch-button:hover,
.wayfarer-storylet-branch-button:focus-visible {
    background: #f8fafc;
    color: #15181d;
}

.wayfarer-storylet-branch-button:disabled {
    cursor: default;
    opacity: 0.55;
}

.wayfarer-presentation-screen {
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow-y: auto;
    padding: clamp(24px, 6vh, 72px) 24px;
    background: #15181d;
    color: #f8fafc;
}


.wayfarer-presentation-screen[hidden] {
    display: none !important;
}


.wayfarer-presentation-inner {
    width: min(1040px, 100%);
    min-height: calc(100vh - clamp(48px, 12vh, 144px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.wayfarer-presentation-media {
    width: 100%;
    margin: 0 0 26px;
    overflow: hidden;
    border-radius: 12px;
    background: #0d0f12;
}


.wayfarer-presentation-media img {
    display: block;
    width: 100%;
    max-height: 52vh;
    object-fit: cover;
}


.wayfarer-presentation-copy {
    width: min(760px, 100%);
    margin: 0 auto;
}


.wayfarer-presentation-eyebrow {
    margin: 0 0 8px;
    color: #b8c0cc;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.wayfarer-presentation-copy h1 {
    margin: 0 0 18px;
    color: inherit;
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: 1.05;
}


.wayfarer-presentation-description {
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}


.wayfarer-presentation-actions {
    width: min(760px, 100%);
    margin: 32px auto 0;
    display: flex;
    justify-content: flex-end;
}


.wayfarer-presentation-continue {
    min-width: 150px;
    padding: 11px 18px;
    border: 1px solid #f8fafc;
    border-radius: 8px;
    background: #f8fafc;
    color: #15181d;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}


.wayfarer-presentation-continue:hover {
    background: #e8edf3;
}


.wayfarer-presentation-continue:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}


.wayfarer-presentation-key-hint {
    margin: 10px 0 0;
    color: #9ea8b6;
    font-size: 0.78rem;
    text-align: right;
}


body.wayfarer-runtime-presentation {
    overflow: hidden;
}


@media (max-width: 620px) {

    .wayfarer-presentation-screen {
        padding: 20px 14px;
    }

    .wayfarer-presentation-inner {
        min-height: calc(100vh - 40px);
    }

    .wayfarer-presentation-actions {
        justify-content: stretch;
    }

    .wayfarer-presentation-continue {
        width: 100%;
    }
}


/* ------------------------------------------------------------------
   COMBINED AUTHOR STATE + REGION
   WAYFARER_COMBINED_AUTHOR_STATE_REGION_V41
------------------------------------------------------------------ */

.wayfarer-author-state-region {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e4e7ec;
}

.wayfarer-author-state-region > :first-child {
    margin-top: 0;
}


/* ------------------------------------------------------------------
   TERMINAL GAME ENDING
   WAYFARER_GAME_ENDING_SCREEN_V45
------------------------------------------------------------------ */

.wayfarer-ending-screen {
    position: fixed;
    z-index: 11000;
    inset: 0;
    overflow-y: auto;
    padding: clamp(24px, 6vh, 72px) 24px;
    background: #11151a;
    color: #f8fafc;
}

.wayfarer-ending-inner {
    width: min(1040px, 100%);
    min-height: calc(100vh - clamp(48px, 12vh, 144px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wayfarer-ending-media {
    width: 100%;
    margin: 0 0 28px;
    overflow: hidden;
    border-radius: 12px;
    background: #080a0d;
}

.wayfarer-ending-media img {
    display: block;
    width: 100%;
    max-height: 52vh;
    object-fit: cover;
}

.wayfarer-ending-copy {
    width: min(760px, 100%);
    margin: 0 auto;
}

.wayfarer-ending-eyebrow {
    margin: 0 0 8px;
    color: #aeb8c5;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wayfarer-ending-copy h1 {
    margin: 0 0 18px;
    color: inherit;
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: 1.05;
}

.wayfarer-ending-text {
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

body.wayfarer-game-ended {
    overflow: hidden;
}

/* ------------------------------------------------------------------
   PRESENTATION TRANSITION + ENDING RESTART
   WAYFARER_PRESENTATION_TRANSITION_V63
   WAYFARER_ENDING_RESTART_V63
------------------------------------------------------------------ */

body.wayfarer-presentation-transitioning::after {
    content: "";
    position: fixed;
    z-index: 10500;
    inset: 0;
    background: #15181d;
    pointer-events: all;
}

.wayfarer-ending-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.wayfarer-ending-restart {
    min-width: 150px;
    padding: 11px 18px;
    border: 1px solid #f8fafc;
    border-radius: 8px;
    background: #f8fafc;
    color: #15181d;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.wayfarer-ending-restart:hover {
    background: #e8edf3;
}

.wayfarer-ending-restart:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

.wayfarer-ending-restart:disabled {
    cursor: default;
    opacity: 0.6;
}

@media (max-width: 620px) {
    .wayfarer-ending-actions {
        justify-content: stretch;
    }

    .wayfarer-ending-restart {
        width: 100%;
    }
}

/* ------------------------------------------------------------------
   GAME HUD SURFACES
   WAYFARER_GAME_TRAVEL_HUD_STYLE_V94
   WAYFARER_HUD_SURFACES_STYLE_V95
------------------------------------------------------------------ */

.wayfarer-player-pane {
    display: flex;
    flex-direction: column;
}

.wayfarer-player-hud {
    flex: 0 0 auto;
}

.wayfarer-travel-hud {
    margin-top: 12px;
}

.wayfarer-action-hud {
    margin-top: auto;
    padding-top: 18px;
}

.wayfarer-player-hud[hidden] {
    display: none !important;
}

.wayfarer-hud-components {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(180px, 100%),
                1fr
            )
        );
    gap: 10px;
}

.wayfarer-hud-component {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d8dbe2;
    border-radius: 9px;
    background: #f8fafc;
}

.wayfarer-hud-number-component {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.wayfarer-hud-number {
    flex: 0 0 auto;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.wayfarer-hud-progress-component {
    min-width: 0;
}

.wayfarer-hud-progress-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.wayfarer-hud-label {
    min-width: 0;
    overflow: hidden;
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wayfarer-hud-value {
    flex: 0 0 auto;
    color: #667085;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.wayfarer-hud-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe4ea;
}

.wayfarer-hud-progress-fill {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: #2f5ea8;
    transition: width 180ms ease;
}

@media (max-width: 620px) {
    .wayfarer-travel-hud {
        margin-top: 10px;
    }

    .wayfarer-action-hud {
        padding-top: 14px;
    }

    .wayfarer-hud-components {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .wayfarer-hud-components {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------
   REGION HUD AUTHORING
   WAYFARER_REGION_HUD_EDITOR_V64
------------------------------------------------------------------ */

.builder-region-hud {
    margin: 0;
}

.builder-region-hud > h3 {
    margin-top: 0;
}

.builder-region-hud-component {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid #d8dbe2;
    border-radius: 8px;
}

.builder-region-hud-component legend {
    padding: 0 6px;
    font-weight: 700;
}

.builder-region-hud-component select,
.builder-region-hud-component input[type="text"] {
    width: min(560px, 100%);
    max-width: 100%;
}

/* ------------------------------------------------------------------
   ONE-TIME EFFECT PLAYER FEEDBACK
   WAYFARER_EFFECT_FEEDBACK_V70
------------------------------------------------------------------ */

.wayfarer-presentation-changes {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(31, 41, 55, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
}

.wayfarer-presentation-changes-heading {
    margin: 0 0 7px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.68;
}

.wayfarer-presentation-changes-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wayfarer-presentation-change {
    margin: 0;
    font-weight: 700;
    line-height: 1.35;
}

.wayfarer-presentation-change.is-gain::before,
.wayfarer-presentation-change.is-loss::before {
    display: inline-block;
    width: 0;
    overflow: hidden;
    content: '';
}