/* Page-specific layout; FlatUI 0.15.0 stays unmodified in flatui/. */
.fui .fui-masthead > p { line-height: 1.65; }
.fui .fui-masthead > .fui-button { align-self: flex-start; }
.fui .fui-panel { min-width: 0; }
.fui .tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fui .tier-grid article { padding: 1.25em 1.5em; }
.fui .tier-grid article + article { border-left: 1px solid var(--game-line); }
.fui .tier-grid h3 { font-size: 1.35em; margin: 0 0 .4em; }
.fui .tier-grid p, .fui .tier-note { color: var(--game-muted); line-height: 1.55; }
.fui .tier-note { margin: 0; padding: .85em 1.5em; border-top: 1px solid var(--game-line); background: var(--game-band); }
.fui #library { scroll-margin-top: 5em; }
.fui .library-foot { padding: .65em 0; }
.fui .living { max-width: 52em; line-height: 1.65; }
.fui .living h2 { font-size: 1.35em; }
.fui .living p { color: var(--game-muted); }
.fui .project-media { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(15em, 1fr); gap: 1.5em; padding: 1.5em; }
.fui .project-media > * { min-width: 0; }
.fui .lead-frame, .fui .fallback-gallery img { display: block; width: 100%; }
.fui .project-facts dl { margin: 0; }
.fui .project-facts dt { color: var(--game-muted); font-size: .75em; text-transform: uppercase; letter-spacing: .08em; margin-top: 1.3em; }
.fui .project-facts dt:first-child { margin-top: 0; }
.fui .project-facts dd { margin: .3em 0 0; font-weight: 650; }
.fui .project-facts .fact-big { font-size: 1.65em; }
.fui .project-facts p { color: var(--game-muted); line-height: 1.55; }
.fui .project-blurb { font-size: 1.12em; }
.fui .fui-prose { max-width: none; }
.fui .fui-prose > p, .fui .fui-prose > ul, .fui .fui-prose > ol { max-width: 70ch; }
.fui .download-row { display: flex; align-items: center; flex-wrap: wrap; gap: 1em; }
.fui .build-badge { padding: .65em .85em; background: var(--game-band); border: 1px solid var(--game-line); border-radius: var(--fui-radius-sm); font-size: .9em; }
.fui .fui-page-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .6em 1.3em; padding: 1.5em; }
.fui .fui-page-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--game-text); }
.fui .fui-page-brand, .fui .fui-button { min-height: 44px; }
.fui .fui-page-footer span { color: var(--game-muted); font-size: .85em; }
@media (max-width: 700px) {
  .fui .tier-grid, .fui .project-media { grid-template-columns: 1fr; }
  .fui .tier-grid article + article { border-left: 0; border-top: 1px solid var(--game-line); }
  .fui .project-media { padding: .85em; gap: 1em; }
  .fui .project-facts dl { display: grid; grid-template-columns: 1fr 1.4fr; gap: .8em; align-items: baseline; }
  .fui .project-facts dt, .fui .project-facts dd { margin: 0; }
  .fui .download-row { align-items: stretch; }
  .fui .download-row .fui-button { width: 100%; }
}
/* Keep the performance overlay free of costly filters. */
.fui .spf-solo-img, .fui .spf-launch-mark { filter: none !important; }
.fui .spf-bar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.fui.fui-page .fui-page-footer a:not([class]) { color: var(--game-text); }
.fui .living-note { color: var(--game-muted); line-height: 1.65; padding: 1em; border: 1px solid var(--game-line); border-radius: var(--fui-radius-sm); }

/* The Library shares normal document flow with the navigation and footer. */
.fui.fui-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.fui.library-page > .fui-page-main { flex: 1; width: 100%; max-width: none; margin: 0; padding: 0; }
.fui.fui-page > .fui-page-main { flex: 1; }
.fui.fui-page > .fui-page-footer { margin-top: auto; }

/* One centered content column across the site; bar backgrounds still span the screen. */
@media (min-width: 900px) {
  .fui.fui-page { --cog-content-width: 76rem; --cog-side-padding: 2rem; }
  .fui.fui-page > .fui-page-main {
    width: 100%;
    max-width: calc(var(--cog-content-width) + 2 * var(--cog-side-padding));
    margin-inline: auto;
    padding-inline: var(--cog-side-padding);
  }
  .fui.fui-page > .fui-page-bar,
  .fui.fui-page > .fui-page-footer {
    width: 100%;
    max-width: none;
    padding-inline: max(var(--cog-side-padding), calc((100% - var(--cog-content-width)) / 2));
  }
}

/* Reserve theme controls before the module loads, keeping the navigation stable. */
.fui .fui-page-tools .fui-select { width: 12em; }
.fui .theme-placeholder { visibility: hidden; }
/* Reserve the host launcher before the embed is ready (including offline). */
.fui [data-shmoperform-launch]:not([data-shmoperform-state]) { visibility: hidden; }
@media (max-width: 40em) {
  .fui .fui-page-tools .fui-select { width: 9em; }
}

/* Research keeps the experiment index a readable, text-only table. */
.fui .research-table-wrap { max-width: 100%; overflow-x: auto; }
.fui .research-table { width: 100%; border-collapse: collapse; text-align: left; line-height: 1.55; }
.fui .research-table caption { text-align: left; color: var(--game-muted); padding: 0 0 .8em; }
.fui .research-table th, .fui .research-table td { padding: 1em .8em; border-bottom: 1px solid var(--game-line); vertical-align: top; }
.fui .research-table thead { background: var(--game-soft); }
.fui .research-table tbody th { width: 23%; }
.fui .research-table td:last-child { width: 18%; }
.fui .research-table small { display: block; color: var(--game-muted); font-weight: 400; }
@media (max-width: 600px) {
  .fui .research-table { font-size: .88em; }
  .fui .research-table th, .fui .research-table td { padding: .8em .45em; overflow-wrap: anywhere; }
}

/* Writeup illustrations, textures and recorded clips use the same asset inventory. */
.writeup-figure { margin: 1.2em 0; }
.writeup-figure img, .writeup-figure video { max-width: 100%; max-height: 42rem; object-fit: contain; }
.writeup-figure.texture img { image-rendering: pixelated; }
.writeup-figure figcaption { color: var(--game-muted); margin-top: .5em; }
.writeup-assets { display: grid; gap: 1.5em; }

/* The shared entrance keeps both generations one click away. */
.fui .frontdoor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.fui .frontdoor-links { display: grid; gap: .5rem; }
.fui .frontdoor-links a { display: block; padding: .8rem; color: var(--game-text); font-size: 1.2rem; font-weight: 650; text-decoration: none; border-radius: var(--fui-radius-sm); }
.fui .frontdoor-links a:hover { background: var(--game-soft); }
.fui .frontdoor-links span { display: block; margin-top: .35rem; color: var(--game-muted); font-size: .9rem; font-weight: 400; }
@media (max-width: 700px) { .fui .frontdoor-grid { grid-template-columns: 1fr; } }

/* Intrinsic image dimensions reserve the brand space before the PNG loads. */
.fui .fui-page-brand > img { width: 144px; height: auto; max-height: none; object-fit: contain; }
