/* the main menu (facility.js): the building live behind a dither scrim, name top left, a plain list bottom left */
html[data-menu="facility"] body.on-title #stage { visibility: visible !important; }
html[data-menu="facility"] .ts-att, html[data-menu="facility"] .ts-fly, html[data-menu="facility"] .ts-demo { display: none !important; }
html[data-menu="facility"] .ts-logo { position: absolute; left: 0; top: 0; visibility: hidden !important; }
html[data-menu="facility"] .ts { color: #e3e1db; }

.fac-scrim { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; image-rendering: pixelated; pointer-events: none; }
.ts.out .fac-scrim, .ts.out .fac-name, .ts.out .fac-cap { display: none; }

/* the name: Boot's, at half its size, top left on the page margin; it types in behind the red block */
html[data-menu="facility"] { --fn: clamp(26px, min(5.3vw, 8.5vh), 80px); }
.fac-name { position: fixed; left: calc(var(--m) - .04em); top: calc(var(--m) - .1em); z-index: 1; margin: 0; font-size: var(--fn); line-height: 1; letter-spacing: -.03em; white-space: nowrap; pointer-events: none; }
.fac-name u { text-decoration: none; position: relative; display: inline-block; width: 0; height: .74em; visibility: hidden; }
.fac-name.typing u { visibility: visible; } .fac-name u::after { content: ""; position: absolute; left: .08em; top: 0; width: .42em; height: 100%; background: var(--accent); }
.fac-name i { font-style: normal; visibility: hidden; } .fac-name i.on { visibility: visible; }
.ts[data-ms="leaving"] .fac-name, .ts[data-ms="leaving"] .fac-cap { animation: fac-out .32s steps(1, end) forwards; }
@keyframes fac-out { 0%, 40% { visibility: visible; } 20%, 60%, 100% { visibility: hidden; } }
html[data-menu="facility"] .ts-lock { position: static; transform: none; display: block; }
html[data-menu="facility"] .ts-sub { position: absolute; left: var(--m); top: calc(var(--m) + var(--fn) + 6px); margin: 0; font-size: 13px; line-height: 16px; color: rgba(227, 225, 219, .62); }

/* until Press Start comes up, no dark covers over the picture */
html[data-menu="facility"] .ts[data-ms="boot"] :is(.ts-sub, .ts-act) { visibility: hidden; }
html[data-menu="facility"] .ts-hint { visibility: hidden; }

/* where the camera is: top right, one line per cut */
.fac-cap { position: fixed; right: var(--m); top: var(--m); z-index: 1; margin: 0; font-size: 13px; line-height: 16px; text-align: right; white-space: nowrap; pointer-events: none; display: flex; gap: 10px; align-items: center; }
.fac-cap b { font-weight: 400; color: rgba(227, 225, 219, .62); }
.fac-cap u { text-decoration: none; display: block; width: 6px; height: 6px; background: var(--accent); visibility: hidden; }
.fac-cap.cut u { visibility: visible; }

/* the list: bottom left, flush with the name; the picked line steps in behind the red block */
html[data-menu="facility"] .ts-act { position: absolute; left: var(--m); right: var(--m); bottom: 84px; top: auto; margin: 0; width: auto; height: auto; }
html[data-menu="facility"] .ts-start { position: relative; left: 0; top: 0; transform: none; padding: 3px 0; display: block; width: max-content; }
html[data-menu="facility"] .ts-start[hidden] { display: none; }
html[data-menu="facility"] .ts-menu { position: relative; left: 0; top: 0; transform: none; gap: 2px; }
html[data-menu="facility"] .ts-menu[hidden] { display: none; }
html[data-menu="facility"] .ts-mi { padding: 3px 0; }
html[data-menu="facility"] .ts-mi .ts-t { opacity: .7; }
html[data-menu="facility"] .ts-mi.on { padding-left: 24px; }
html[data-menu="facility"] .ts-mi.on .ts-t { opacity: 1; }
html[data-menu="facility"] .ts-mi.on .ts-note { opacity: .7; }
/* Theme: the look in use keeps its square, the cursor is a bar in the margin */
html[data-menu="facility"] .ts-menu.opts .ts-mi, html[data-menu="facility"] .ts-menu.opts .ts-mi.on { padding-left: 26px; }
html[data-menu="facility"] .ts-menu.opts .ts-cur { left: -10px; }
html[data-menu="facility"] .ts-credits { padding-left: 0; color: rgba(227, 225, 219, .86); }

/* footer: © left */
html[data-menu="facility"] .ts-copy { opacity: .62; }

@media (max-width: 860px) {
  html[data-menu="facility"] { --fn: min(6.7vw, 30px); }
  html[data-menu="facility"] .ts-act { bottom: 72px; }
  html[data-menu="facility"] .ts-start, html[data-menu="facility"] .ts-mi { font-size: 22px; }
  html[data-menu="facility"] .ts-mi .ts-note { font-size: 13px; }
  .fac-cap { top: auto; bottom: calc(var(--m) + 28px); right: var(--m); display: none; }
}

/* 26 Nov: no Press Start, no subtitle. The name and the menu in one column on the left, pinned from the top so nothing moves
   when the menu (or a submenu of another length) comes in; the © on the same left edge at the foot */
html[data-menu="facility"] { --fm: clamp(40px, 6vw, 112px); --ft: clamp(96px, 27vh, 280px); }
html[data-menu="facility"] .ts-act { position: fixed; left: var(--fm); right: auto; top: var(--ft); bottom: auto; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; width: auto; height: auto; margin: 0; padding: 0; pointer-events: none; }
html[data-menu="facility"] .ts-act > * { pointer-events: auto; }
html[data-menu="facility"] .ts-act .fac-name { position: relative; left: -.04em; top: auto; margin-bottom: 40px; }
html[data-menu="facility"] .ts-start { display: none !important; }
/* (27 Nov) under the name: what this is, small and dim */
html[data-menu="facility"] .ts-act .ts-sub { position: relative; left: 0; top: auto; display: block; margin: -30px 0 36px; font-size: 15px; line-height: 18px; letter-spacing: .04em; text-transform: uppercase; color: rgba(227, 225, 219, .88); }
@media (max-width: 860px) { html[data-menu="facility"] .ts-act .ts-sub { margin: -24px 0 28px; font-size: 13px; line-height: 16px; } }
html[data-menu="facility"] .ts-copy { position: fixed; left: var(--fm); bottom: calc(var(--m) + 4px); transform: none; }
@media (max-width: 860px) { html[data-menu="facility"] { --fm: 28px; --ft: clamp(40px, 9vh, 96px); } html[data-menu="facility"] .ts-act .fac-name { margin-bottom: 32px; } html[data-menu="facility"] .ts-mi { padding: 0; } }      /* (27 Nov: higher up, so the whole list shows on short phones) */
/* Achievements (26 Nov): a solid panel in the game's UI, a grid of tiles with the toast's pixel icons; found ones lit, the rest dim */
html[data-menu="facility"] .ts-ach { width: min(656px, calc(100vw - 2 * var(--fm) + 16px)); margin: 0 0 18px -16px; padding: 14px 16px 16px; box-sizing: border-box; background: rgba(20, 20, 20, .8); color: #e3e1db; box-shadow: none; white-space: normal; }
html[data-menu="facility"] .ts-ach-hd { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #2f2e2a; font-size: 11px; line-height: 13px; letter-spacing: .04em; text-transform: uppercase; color: #a8a69f; }
html[data-menu="facility"] .ts-ach-pips { display: flex; gap: 4px; } html[data-menu="facility"] .ts-ach-pips i { width: 8px; height: 8px; background: #2f2e2a; } html[data-menu="facility"] .ts-ach-pips i.got { background: #e3e1db; }
html[data-menu="facility"] .ts-ach-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
html[data-menu="facility"] .ts-ach-t { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 8px; background: #1b1a18; }
html[data-menu="facility"] .ts-ach-t canvas { width: 36px; height: 36px; image-rendering: pixelated; background: #0f0f0e; }
html[data-menu="facility"] .ts-ach-t p { margin: 0; font-size: 13px; line-height: 16px; color: #6d6a62; }
html[data-menu="facility"] .ts-ach-t b { display: block; margin-bottom: 2px; font-weight: 400; font-size: 11px; line-height: 13px; letter-spacing: .04em; text-transform: uppercase; color: #8d8b84; }
html[data-menu="facility"] .ts-ach-t.got { background: #22211e; } html[data-menu="facility"] .ts-ach-t.got p { color: #e3e1db; } html[data-menu="facility"] .ts-ach-t.got b { color: #e3e1db; }
html[data-menu="facility"] .ts-ach-t.got canvas { background: #0f0f0e; }
@media (max-width: 860px) { html[data-menu="facility"] .ts-ach-g { grid-template-columns: 1fr; } html[data-menu="facility"] .ts-ach { max-height: 58vh; overflow: auto; } }
html[data-menu="facility"] .ts-ach-t.na { opacity: .45; }
html[data-menu="facility"] .ts-ach { max-height: calc(100vh - var(--ft) - 300px); overflow: auto; scrollbar-width: none; }
html[data-menu="facility"] .ts-ach-na { margin: 12px 0 0; font-size: 11px; line-height: 13px; letter-spacing: .04em; text-transform: uppercase; color: #6d6a62; }
/* (27 Nov) phones: the achievements are one list you scroll through in full, Reset and Back at its end (the title layer
   takes every touch, so the panel's own little scroll could never move) */
@media (max-width: 860px) {
  html[data-menu="facility"] .ts-menu.ach { position: fixed; inset: 0; z-index: 6; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: calc(20px + env(safe-area-inset-top, 0px)) var(--fm, 16px) calc(48px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; background: rgba(12, 12, 11, .92); }
  html[data-menu="facility"] .ts-menu.ach * { touch-action: pan-y; }
  html[data-menu="facility"] .ts-menu.ach .ts-ach { max-height: none; overflow: visible; width: 100%; margin: 0 0 18px; }
  html[data-menu="facility"] .ts:has(.ts-menu.ach) .ts-copy { display: none; }
}
/* (27 Nov) phones: the menu (title and in game) sits in the middle of the screen, every line centred */
@media (max-width: 860px) {
  html[data-menu="facility"] .ts-act { left: 0; right: 0; top: 0; bottom: 0; padding: env(safe-area-inset-top, 0px) 20px env(safe-area-inset-bottom, 0px); align-items: center; justify-content: center; text-align: center; }
  html[data-menu="facility"] .ts-act .fac-name { left: 0; align-self: center; }
  html[data-menu="facility"] .ts-act .ts-sub { text-align: center; }
  html[data-menu="facility"] .ts-act .ts-menu { display: flex; flex-direction: column; align-items: center; }
  html[data-menu="facility"] .ts-mi, html[data-menu="facility"] .ts-mi.on { justify-content: center; padding-left: 0; }
}
@media (max-width: 860px) { html[data-menu="facility"] .ts-menu.ach, html[data-menu="facility"] .ts-ach, html[data-menu="facility"] .ux-pane, html[data-menu="facility"] .ts-box { text-align: left; } }
/* (27 Nov, later) phones: the name 30% larger, set with its line as one group, a bit more room before the menu; the block is
   placed from the top (not centred by its content), so the name types in where it ends up and the menu fills in under it */
@media (max-width: 860px) {
  html[data-menu="facility"] { --fn: min(8.7vw, 39px); }
  html[data-menu="facility"] .ts-act .fac-name { margin-bottom: 30px; }
  html[data-menu="facility"] .ts-act .ts-sub { margin: -22px 0 44px; }
  html[data-menu="facility"] .ts-act { justify-content: flex-start; padding-top: max(calc(24px + env(safe-area-inset-top, 0px)), calc(50svh - var(--blk, 227px))); }
}
/* (27 Nov) desktop too: the menu in the middle of the screen, every line centred (as it was at first); the block is placed
   from the top so the name types in where it ends up */
@media (min-width: 861px) {
  html[data-menu="facility"] .ts-act { left: 0; right: 0; top: 0; bottom: 0; padding: max(32px, calc(50vh - var(--blkd, 200px))) 24px 32px; align-items: center; justify-content: flex-start; text-align: center; }
  html[data-menu="facility"] .ts-act .fac-name { left: 0; align-self: center; }
  html[data-menu="facility"] .ts-act .ts-sub { text-align: center; }
  html[data-menu="facility"] .ts-act .ts-menu { display: flex; flex-direction: column; align-items: center; }
  html[data-menu="facility"] .ts-mi, html[data-menu="facility"] .ts-mi.on { justify-content: center; padding-left: 0; }
  html[data-menu="facility"] .ts-menu.ach, html[data-menu="facility"] .ts-ach, html[data-menu="facility"] .ux-pane, html[data-menu="facility"] .ts-box { text-align: left; }
}
/* (27 Nov) centred menus: each row only as wide as its words, so its red marker and caret sit right beside them */
html[data-menu="facility"] .ts-act .ts-mi { width: max-content; max-width: 100%; align-self: center; }
/* (28 Nov) every row's marker is the same red square, just left of its words, never over them: the menu lets it hang
   outside its box (Theme keeps its own look: the outline boxes, the filled one in use, the bar) */
html[data-menu="facility"] .ts-menu { overflow: visible; }
/* (28 Nov) the name a little larger and 30% more room between its line and the menu; the menu keeps its place in the
   middle, so the name and its line move up by what they gained. The © sits centred at the foot, under everything */
html[data-menu="facility"] { --fn0: clamp(26px, min(5.3vw, 8.5vh), 80px); --fn: calc(1.12 * var(--fn0)); --blkd: calc(211px + .12 * var(--fn0)); }
html[data-menu="facility"] .ts-act .ts-sub { margin-bottom: 47px; }
@media (max-width: 860px) {
  html[data-menu="facility"] { --fn0: min(8.7vw, 39px); --fn: calc(1.1 * var(--fn0)); --blk: calc(240px + .1 * var(--fn0)); }
  html[data-menu="facility"] .ts-act .ts-sub { margin-bottom: 57px; }
}
html[data-menu="facility"] .ts-copy { left: 50%; right: auto; transform: translateX(-50%); text-align: center; white-space: nowrap; }
/* (28 Nov) the marker stays lit (it no longer blinks), so a picked row always shows it */
html[data-menu="facility"] .ts-menu:not(.opts) .ts-cur.idle { animation: none; }
/* (28 Nov) Theme: no bar beside the looks; Back gets the menu's red square when picked */
html[data-menu="facility"] .ts-menu.opts .ts-cur { visibility: hidden; animation: none; }
html[data-menu="facility"] .ts-menu.opts .ts-cur.bk { visibility: visible; left: 0; width: 12px; border: 0; background: var(--accent); }
