/* OWNER: D (game). All chrome. The picture fills the screen. Words are either ink on a brushed wash or
   ink on a paper tag; both are painted at load by brush.js and arrive here as --wash and --paper. */
html, body { margin: 0; height: 100%; background: #171925; overflow: hidden; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; -webkit-tap-highlight-color: transparent; }
#sh-ui { position: fixed; inset: 0; pointer-events: none; color: #EFE6D2; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'URW Palladio L', P052, 'Noto Serif', Georgia, serif;
  font-kerning: normal; -webkit-font-smoothing: antialiased; }
#sh-ui svg.fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#sh-ui .fx .string { fill: none; stroke: #EFE6D2; stroke-width: 1.4; stroke-linecap: round; opacity: 0; transition: opacity 1s ease; }
#sh-ui .fx .knot { fill: #171925; stroke: #EFE6D2; stroke-width: 1.4; opacity: 0; transition: opacity 1s ease; }
#sh-ui .fx.choosing .string, #sh-ui .fx.choosing .knot { opacity: .9; }
#sh-ui .fx .ring { fill: none; stroke: #DDE0EE; stroke-width: 1.5; }
#sh-ui .fx .focus { fill: none; stroke: #EFE6D2; stroke-width: 1.6; stroke-dasharray: 5 6; stroke-linecap: round; opacity: 0; transition: opacity .25s ease; }
#sh-ui .fx .focus.on { opacity: .9; }

/* one line at a time, in the lower third, on a pull of dark wash so it holds over the warm stair wall */
#sh-ui .cap { position: absolute; left: 0; right: 0; bottom: max(4.4vh, calc(env(safe-area-inset-bottom) + 16px)); height: 0; }
#sh-ui .line { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); margin: 0; box-sizing: border-box;
  width: max-content; max-width: min(95vw, 800px); padding: .6em .9em .7em; text-align: center; text-wrap: balance;
  font-size: clamp(17px, 2.45vmin, 23px); line-height: 1.34; letter-spacing: .012em; color: #EFE6D2;
  /* the wash is cut in three so its brushed ends keep their shape however long the line is */
  border-style: solid; border-color: transparent; border-width: 0 2.1em; border-image: var(--wash) 0 100 0 100 fill / 0 2.1em / 0 stretch;
  opacity: 0; transition: opacity .3s ease; }
#sh-ui .line.on { opacity: 1; transition: opacity .26s ease-out; }   /* (round fifteen: was .65 s after .14 s; over the warm shelf the words sat faint, half there, for most of a second) */
/* every voice has a dot of its own colour: Marlow's green, Jo's straw hat, the neighbour's coat */
#sh-ui .line.marlow::before, #sh-ui .line.jo::before, #sh-ui .line.tam::before { content: ''; display: inline-block; width: .44em; height: .44em;
  border-radius: 50%; margin-right: .62em; vertical-align: .13em; }
#sh-ui .line.marlow { font-variant: small-caps; letter-spacing: .085em; font-size: clamp(14.5px, 2.1vmin, 19.5px); color: #A9E3C6; }
#sh-ui .line.marlow::before { background: #7FD6A8; }
#sh-ui .line.jo::before { background: #D9B77A; }
#sh-ui .line.tam { color: #DCE4EF; }
#sh-ui .line.tam::before { background: #8FA0B8; }
#sh-ui .line.look { font-style: italic; color: #D9DCEA; }
/* night one: the neighbour's handwriting, on the tag itself */
#sh-ui .line.tag { font-style: italic; color: #20212E; background: var(--paper) 0 0 / 128px 128px; padding: .5em 1.5em .56em 2.3em; border: 0; border-image: none;
  transform: translateX(-50%) rotate(-.8deg); transform-origin: 50% 100%; border-radius: 2px; box-shadow: 2px 3px 0 rgba(23, 25, 37, .62); bottom: 6px; }
/* the string hole: small, with the pale ring a real tag has around it */
#sh-ui .line.tag::before, #sh-ui .ptag::before { content: ''; position: absolute; left: .95em; top: 50%; width: .36em; height: .36em; margin-top: -.18em;
  border-radius: 50%; background: #343B62; box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .35), 0 0 0 .17em rgba(32, 33, 46, .11); }
#sh-ui .timecard { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); margin: 0; width: max-content; max-width: 90vw; text-align: center;
  font-size: clamp(21px, 3.4vmin, 31px); font-style: italic; letter-spacing: .035em; color: #EFE6D2; opacity: 0; transition: opacity 1.2s ease;
  text-shadow: 0 1px 0 rgba(23, 25, 37, .8), 0 0 18px rgba(23, 25, 37, .8); }
#sh-ui .timecard.on { opacity: 1; }

/* cards: title and end. The roof stays in the middle; words keep to the sky and the foot of the sheet. */
#sh-ui .card { position: absolute; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: max(8.5vh, calc(env(safe-area-inset-top) + 34px)) 18px max(7vh, calc(env(safe-area-inset-bottom) + 26px)); text-align: center;
  background: linear-gradient(180deg, rgba(23, 25, 37, .7) 0%, rgba(23, 25, 37, .36) 28%, rgba(23, 25, 37, 0) 50%, rgba(23, 25, 37, .3) 74%, rgba(23, 25, 37, .74) 100%);
  opacity: 0; visibility: hidden; transition: opacity 1.1s ease, visibility 0s linear 1.1s; }
#sh-ui .card.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 1.1s ease, visibility 0s; }
#sh-ui .card .head, #sh-ui .card .foot { display: flex; flex-direction: column; align-items: center; gap: 1.7vh; max-width: 100%; }
#sh-ui .lettering { display: block; max-width: 100%; }
#sh-ui .sub { margin: 0; font-style: italic; font-size: clamp(16.5px, 2.6vmin, 24px); letter-spacing: .02em; color: #D9DCEA; text-shadow: 0 1px 0 rgba(23, 25, 37, .7); }
#sh-ui .small { margin: .6vh 0 0; font-style: italic; font-size: 14px; line-height: 1.4; letter-spacing: .03em; color: #B4B9D2; text-shadow: 0 1px 0 rgba(23, 25, 37, .7); }
#sh-ui.short .card { padding-top: 5vh; padding-bottom: 4vh; }

#sh-ui button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; pointer-events: auto;
  -webkit-appearance: none; appearance: none; touch-action: manipulation; }
#sh-ui button:disabled { pointer-events: none; cursor: default; }
/* a paper tag on a string hole: Begin, Begin again, and the two labels of the choice */
#sh-ui .ptag { --rot: -1.1deg; --tx: 0px; --ty: 0px; --dy: 0px; position: relative; box-sizing: border-box; min-height: 48px; padding: .58em 1.6em .64em 2.4em;
  color: #20212E; background: var(--paper) 0 0 / 128px 128px; border-radius: 2px; font-size: clamp(17.5px, 2.6vmin, 23px); letter-spacing: .06em;
  box-shadow: 2px 3px 0 rgba(23, 25, 37, .74); transform: translate(var(--tx), calc(var(--ty) + var(--dy))) rotate(var(--rot));
  transition: transform .3s ease, box-shadow .3s ease, opacity 1s ease; }
#sh-ui .ptag:hover { --dy: -2px; box-shadow: 3px 5px 0 rgba(23, 25, 37, .74); }
#sh-ui .ptag:active { --dy: 1px; box-shadow: 1px 1px 0 rgba(23, 25, 37, .74); }
#sh-ui .ptag:focus-visible, #sh-ui .choice.focus { outline: 2px dashed #EFE6D2; outline-offset: 5px; }
#sh-ui .choice { --tx: -50%; --ty: -50%; --rot: -1deg; position: absolute; white-space: nowrap; font-size: clamp(15.5px, 2.25vmin, 19.5px);
  letter-spacing: .015em; padding: .62em 1.2em .66em 2.25em; opacity: 0; }
#sh-ui .choice + .choice { --rot: .9deg; }
#sh-ui .choice.on { opacity: 1; }
#sh-ui .choice.off { pointer-events: none; }

/* a thing out of frame: one small paper chevron at the edge, breathing like everything else that can be tapped */
#sh-ui .arrow { position: absolute; width: 48px; height: 48px; transform: translate(-50%, -50%); opacity: 0; transition: opacity .8s ease; }
#sh-ui .arrow i { position: absolute; inset: 3px; background: var(--chev) center / 100% 100% no-repeat; }
#sh-ui .arrow.on { opacity: 1; }
#sh-ui .arrow.on::after { content: ''; position: absolute; inset: 0; }
#sh-ui .arrow.off { pointer-events: none; opacity: 0; transition-duration: 0s; visibility: hidden; }
@keyframes sh-breathe { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
#sh-ui .arrow.on i { animation: sh-breathe 3.2s ease-in-out infinite; }
#sh-ui .arrow.on.nudge i { animation: sh-nudge 1.6s ease-in-out 1; }
@keyframes sh-nudge { 0% { scale: 1; } 30% { scale: 1.55; filter: brightness(1.5); } 60% { scale: 1.05; } 80% { scale: 1.3; } 100% { scale: 1; } }

#sh-ui .snd { position: absolute; top: max(6px, env(safe-area-inset-top)); right: 6px; min-width: 48px; min-height: 44px; padding: 0 12px;
  display: flex; align-items: center; gap: .55em; font-size: 14px; letter-spacing: .1em; font-variant: small-caps; color: #D9DCEA; opacity: .7;
  text-shadow: 0 1px 2px rgba(23, 25, 37, .9); transition: opacity .3s ease; }
#sh-ui .snd i { width: .5em; height: .5em; border-radius: 50%; background: #D9DCEA; box-shadow: 0 0 0 1.5px #D9DCEA; }
#sh-ui .snd.off i { background: transparent; }
#sh-ui .snd:hover, #sh-ui .snd:focus-visible { opacity: 1; outline: none; }
#sh-ui .snd:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* the end card: what the record holds, in Marlow's hand, and what it does not, in nobody's */
#sh-ui .ledger { box-sizing: border-box; display: grid; gap: .45em; padding: 1em .8em 1.1em; max-width: min(94vw, 760px); margin-bottom: 1.4vh;
  border-style: solid; border-color: transparent; border-width: 0 2.1em; border-image: var(--wash) 0 100 0 100 fill / 0 2.1em / 0 stretch;
  font-size: clamp(15.5px, 2.25vmin, 20.5px); line-height: 1.38; text-align: left; }
#sh-ui .ledger p { margin: 0; display: grid; grid-template-columns: 8.4em 1fr; column-gap: 1.1em; align-items: baseline; }
#sh-ui .ledger b { font-weight: 400; text-align: right; white-space: nowrap; }
#sh-ui .ledger .rec b { font-variant: small-caps; letter-spacing: .085em; color: #A9E3C6; }
#sh-ui .ledger .rec b::before { content: ''; display: inline-block; width: .44em; height: .44em; border-radius: 50%; margin-right: .55em; vertical-align: .13em; background: #7FD6A8; }
#sh-ui .ledger .off b, #sh-ui .ledger .off span { font-style: italic; }
#sh-ui .ledger .off b { color: #D9B77A; }
/* the night after, by sensor, when she came up anyway: the lamp's colour comes up from the foot of the card */
#sh-ui .card.end.kept { background: linear-gradient(180deg, rgba(23, 25, 37, .62) 0%, rgba(23, 25, 37, .24) 28%, rgba(23, 25, 37, 0) 50%, rgba(120, 72, 28, .26) 76%, rgba(70, 40, 20, .72) 100%); }
#sh-ui .card.end.kept.on { transition: opacity 2.6s ease, visibility 0s; }
#sh-ui .card.end.kept .ledger .rec b { color: #F0D29A; }
#sh-ui .card.end.kept .ledger .rec b::before { background: #E9B65E; }
#sh-ui.tall .ledger { padding: 1em .2em 1.1em; gap: .7em; }
#sh-ui.tall .ledger p { grid-template-columns: 1fr; text-align: center; row-gap: .1em; }
#sh-ui.tall .ledger b { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  #sh-ui .line, #sh-ui .line.on, #sh-ui .card, #sh-ui .card.on, #sh-ui .choice, #sh-ui .arrow, #sh-ui .timecard, #sh-ui .ptag { transition-duration: .01s; transition-delay: 0s; }
  #sh-ui .arrow.on i, #sh-ui .arrow.on.nudge i { animation: none; }
}

/* On the xbox50 the roof is on a TV across a room, played with one stick and one button. Words are set in shares of
   the screen, not pixels, and keep clear of the edge a TV may crop and of the console's own hint at the foot. */
#sh-ui.tv .cap { bottom: 10vh; }
#sh-ui.tv .line { font-size: 3.3vmin; max-width: 84vw; }
#sh-ui.tv .line.marlow { font-size: 2.9vmin; }
#sh-ui.tv .timecard { font-size: 4.6vmin; }
#sh-ui.tv .card { padding: 9vh 6vw 11vh; }
#sh-ui.tv .sub { font-size: 3.4vmin; }
#sh-ui.tv .small { font-size: 2.3vmin; }
#sh-ui.tv .ptag { font-size: 3.2vmin; }
#sh-ui.tv .choice { font-size: 2.9vmin; }
#sh-ui.tv .ledger { font-size: 2.9vmin; max-width: 84vw; }
#sh-ui.tv .snd { display: none; }
#sh-ui.tv .fx .focus { stroke-width: .42vmin; stroke-dasharray: 1.1vmin 1.2vmin; }
#sh-ui.tv .fx .ring { stroke-width: .3vmin; }
#sh-ui.tv .fx .string, #sh-ui.tv .fx .knot { stroke-width: .25vmin; }
#sh-ui.tv .begin, #sh-ui.tv .again, #sh-ui.tv .choice.focus { outline: .3vmin dashed #EFE6D2; outline-offset: .7vmin; }
