/* The site's one look: black, hard edges, white. Each door has a second colour of its own: red, or the paper door's green.
   The letters are Paper Kit's: Pixel Operator for everything read or pressed, PX Garamond for a heading. Both are
   pixel fonts, drawn at 16px or a whole multiple of it. Their licences are in the repository's licences folder. */

@font-face { font-family: "Pixel Operator"; src: url("/site/pixel-operator.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: "PX Garamond"; src: url("/site/px-garamond.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: block; }

:root {
  --ink: #fff;
  --hot: #ff2a1c;
  --bad: #ff2a1c;
  --dim: #a8a8a8;
  --edge: 2px;
  --ui: "Pixel Operator", ui-monospace, monospace;
  --serif: "PX Garamond", Georgia, serif;
  color-scheme: dark;
}
:root[data-door="paper"] { --hot: #2ee66e; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font: 16px/20px var(--ui);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; }
canvas { image-rendering: pixelated; }
.px { color: inherit; }
.px.head { font: 32px/32px var(--serif); }
[hidden] { display: none !important; }
p.words { margin: 0; color: var(--dim); }

/* ---- a door */

body.door { overflow: hidden; overscroll-behavior: none; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#stage { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; z-index: 6;
  padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.skip { position: fixed; left: 8px; top: 8px; z-index: 7; opacity: 0; pointer-events: none;
  background: #000; color: var(--ink); border: var(--edge) solid var(--ink); padding: 4px 8px; }
.skip:focus-visible { opacity: 1; pointer-events: auto; outline: none; }
.plain { position: fixed; inset: auto 0 16px 0; text-align: center; }

/* ---- a window: carried by its bar, which is only a line of small words */

.win {
  pointer-events: auto;
  width: min(340px, 100%);
  max-height: 100%;
  overflow: auto;
  background: #000;
  border: var(--edge) solid var(--ink);
  animation: pop 110ms steps(3, jump-none) 1;
}
@keyframes pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px;
  padding: 0 0 0 8px; color: var(--dim); border-bottom: 1px solid var(--dim);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.win.carried .bar { cursor: grabbing; color: var(--ink); }
.shut { background: none; color: var(--dim); border: 0; width: 28px; height: 24px; padding: 0 0 2px; cursor: pointer; flex: none; }
.shut:hover, .shut:focus-visible { background: var(--hot); color: #000; outline: none; }
.inside { display: grid; gap: 12px; padding: 16px 12px 8px; }
.form { display: grid; gap: 12px; }
.row { display: grid; gap: 4px; color: var(--dim); }
.entry {
  width: 100%; min-height: 40px; padding: 8px;
  background: #000; color: var(--ink); caret-color: var(--hot);
  border: var(--edge) solid var(--ink); border-radius: 0; outline: none;
  font: 16px/20px var(--ui);                                   /* 16px: a phone does not zoom in on it */
}
.entry:focus { border-color: var(--hot); box-shadow: inset 0 0 0 2px var(--hot); }   /* thicker as well as coloured */
.entry:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 40px #000 inset; }
.key {
  min-height: 44px; padding: 8px 12px; cursor: pointer;
  background: var(--ink); color: #000; border: var(--edge) solid var(--ink); border-radius: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.key:hover, .key:focus-visible { background: var(--hot); border-color: var(--hot); outline: none; }
.key:active { transform: translate(2px, 2px); }
.key:disabled { opacity: 0.5; cursor: wait; }
.key.quiet { background: #000; color: var(--ink); }
.key.quiet:hover, .key.quiet:focus-visible { background: #000; color: var(--hot); border-color: var(--hot); }
.tick { display: flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; }
.tick input { appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border: var(--edge) solid var(--ink); background: #000; border-radius: 0; }
.tick input:checked { background: var(--hot); box-shadow: inset 0 0 0 3px #000; }
.tick input:focus-visible { outline: var(--edge) solid var(--hot); outline-offset: 2px; }
.said { margin: 0; padding: 4px 12px 12px; color: var(--bad); min-height: 8px; }
.said:empty { padding-bottom: 4px; }
.said.good { color: var(--ink); }
.qr { display: block; justify-self: center; border: var(--edge) solid var(--ink); line-height: 0; }
.secret { justify-self: center; font: inherit; letter-spacing: 1px; user-select: all; word-break: break-all; text-align: center; }
.codes { margin: 0; padding: 8px; border: var(--edge) solid var(--ink); font: inherit; line-height: 24px; letter-spacing: 1px; text-align: center; user-select: all; }

/* ---- after signing in */

body.home { min-height: 100%; }
#home { max-width: 720px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); display: grid; gap: 24px; }
body.home #stage { background: rgba(0, 0, 0, 0.75); pointer-events: none; }
body.home #stage:empty { display: none; }
body.home #stage > * { pointer-events: auto; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: var(--edge) solid var(--ink); }
.who { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch { display: grid; gap: 16px; }
.tile { display: flex; align-items: center; gap: 16px; padding: 16px; min-height: 104px; text-decoration: none;
  background: var(--ink); color: #000; border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 0 var(--hot); }
.tile.paper { box-shadow: 6px 6px 0 0 #2ee66e; }
.tile.one { box-shadow: 6px 6px 0 0 #ff2a1c; }
.tile:hover, .tile:focus-visible { transform: translate(3px, 3px); box-shadow: 3px 3px 0 0 var(--hot); outline: none; }
.tile.paper:hover, .tile.paper:focus-visible { box-shadow: 3px 3px 0 0 #2ee66e; }
.tile.one:hover, .tile.one:focus-visible { box-shadow: 3px 3px 0 0 #ff2a1c; }
.art { display: flex; gap: 8px; flex: none; }
.pixels { display: block; image-rendering: pixelated; }
.tile .words { display: grid; gap: 8px; min-width: 0; }
.tile p.words { color: #000; }
.empty { display: grid; gap: 8px; padding: 16px; border: var(--edge) dashed var(--dim); }
.account { display: grid; gap: 16px; }
.part { display: grid; gap: 8px; padding-top: 12px; border-top: var(--edge) solid var(--dim); }
.part > .px, .part > summary { margin-bottom: 4px; color: var(--dim); }
summary { cursor: pointer; list-style: none; min-height: 28px; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; width: 12px; color: var(--hot); }
details[open] > summary::before { content: "-"; }
summary:focus-visible { outline: var(--edge) solid var(--hot); outline-offset: 2px; }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; }
.fact { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.key.small { min-height: 36px; padding: 4px 8px; flex: none; background: #000; color: var(--ink); }
.key.small:hover, .key.small:focus-visible { background: var(--hot); color: #000; }
.gap { height: 8px; }
.account > .said { padding: 0; min-height: 0; }
@media (max-width: 480px) {
  .tile { gap: 12px; padding: 12px; }
  .key.small { min-height: 44px; }
}
