/* ZUZZ: a forgotten 2007 flash game. One face of its own (Zuzz Paint, a crooked pixel face drawn after the owner's
   banner wordmark) + Cousine only for the contract address. Buttons are crooked MS-Paint raster frames. */
@font-face { font-family: "Zuzz Paint"; src: url("/fonts/zuzz-paint.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Cousine"; src: url("/fonts/cousine.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #b8ac9e; --ink: #000; --accent: #000; --paper: #ded4c4; --wall: #c4b8aa;
  --font-display: "Zuzz Paint", monospace;
  --font-body: "Zuzz Paint", monospace;
  --menu: clamp(17px, 1.35vw, 26px);
  --col: clamp(300px, 30vw, 560px);
}
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  --halo: 3px 0 0 var(--wall), -3px 0 0 var(--wall), 0 3px 0 var(--wall), 0 -3px 0 var(--wall), 3px 3px 0 var(--wall), -3px -3px 0 var(--wall), 3px -3px 0 var(--wall), -3px 3px 0 var(--wall);
  background: var(--bg); color: var(--ink); touch-action: none; -webkit-tap-highlight-color: transparent; font-family: var(--font-body); }

.gl, .fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.gl { z-index: 0; }
.fx { z-index: 2; pointer-events: none; }

/* the game's own interface, painted over the flight view */
.ui {
  position: fixed; z-index: 1; left: clamp(18px, 3vw, 64px); top: clamp(14px, 3vh, 44px);
  width: var(--col); pointer-events: none; user-select: none;
}
.ui a, .ui button, .ui .ca, .ui .lore { pointer-events: auto; }
.title { margin: 0; font: clamp(76px, 9.5vw, 190px)/.82 var(--font-display); letter-spacing: .02em; text-transform: uppercase; text-shadow: var(--halo); }
.sub { margin: .5em 0 0; font: var(--menu)/1.2 var(--font-display); text-transform: uppercase; display: flex; gap: .7em; flex-wrap: wrap; text-shadow: var(--halo); }
body[data-room="home"] [data-tag-next], body[data-room="next"] [data-tag-home],
body[data-room="home"] [data-howto-next], body[data-room="next"] [data-howto-home],
body[data-room="home"] [data-lore] { display: none; }
body.touch [data-desk], body:not(.touch) [data-touch] { display: none; }

/* crooked paint buttons: a hand-drawn frame (raster) stretched by border-image; pressed = filled black */
.menu { list-style: none; margin: clamp(14px, 2.6vh, 34px) 0 0; padding: 0; display: grid; gap: clamp(4px, .8vh, 10px); justify-items: start; }
.menu li { margin: 0; }
.btn {
  display: inline-flex; align-items: center; gap: .55em; min-height: 52px; padding: .55em 1.1em .5em;
  font: var(--menu)/1.1 var(--font-display); text-transform: uppercase; color: var(--ink); text-decoration: none; cursor: pointer;
  background: none; border: 14px solid transparent; border-image: url("/img/ui/frame-1.png") 22 fill / 14px / 0 stretch;
  transform-origin: 30% 60%; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.btn > span { margin: -10px -6px; }
.b2 { border-image-source: url("/img/ui/frame-2.png"); transform: rotate(-.6deg); }
.b3 { border-image-source: url("/img/ui/frame-3.png"); transform: rotate(.5deg); }
.btn img { width: 1.35em; height: 1.35em; object-fit: contain; flex: none; margin: -10px 0 -10px -6px; }
.btn:hover, .btn:focus-visible { transform: rotate(-1.5deg) scale(1.04); outline: none; }
.btn:active, .btn.is-hit { border-image-source: url("/img/ui/fill-1.png"); color: var(--paper); transform: scale(.96); transition-duration: .035s; }
.b2:active, .b2.is-hit { border-image-source: url("/img/ui/fill-2.png"); }
.b3:active, .b3.is-hit { border-image-source: url("/img/ui/fill-3.png"); }
.btn:active .mk-x, .btn.is-hit .mk-x { filter: invert(1); }
.btn:focus-visible { border-image-source: url("/img/ui/fill-1.png"); color: var(--paper); }
.btn:focus-visible .mk-x { filter: invert(1); }
.btn.is-off { opacity: 1; cursor: pointer; }

.cheat { margin-top: clamp(12px, 2vh, 26px); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; max-width: 34em; }
.cheat-h { grid-column: 1 / -1; margin: 0; font: var(--menu)/1.1 var(--font-display); text-transform: uppercase; text-shadow: var(--halo); }
.field { border: 14px solid transparent; border-image: url("/img/ui/field-3.png") 22 fill / 14px / 0 stretch; padding: .15em .7em; min-height: 52px; display: flex; align-items: center; }
.ca { font: clamp(16px, .95vw, 19px)/1.3 "Cousine", monospace; user-select: all; cursor: text; color: var(--ink); opacity: 1; overflow-wrap: anywhere; margin: -6px 0; }
.copy { min-height: 52px; white-space: nowrap; }

.lore { margin: clamp(12px, 2vh, 26px) 0 0; max-width: 26em; font: clamp(16px, 1.05vw, 20px)/1.45 var(--font-body); text-transform: uppercase; user-select: text; text-shadow: var(--halo); }
.howto { margin: clamp(10px, 1.6vh, 20px) 0 0; max-width: 30em; font: clamp(16px, 1vw, 19px)/1.45 var(--font-body); text-transform: uppercase; text-shadow: var(--halo); }

/* next door: night, the paper keeps its colour, the loose type turns cream on a dark halo */
body[data-room="next"] { --wall: #1d2230; }
body[data-room="next"] .title, body[data-room="next"] .sub, body[data-room="next"] .cheat-h, body[data-room="next"] .lore, body[data-room="next"] .howto { color: #f3e9c9; }

@media (max-width: 760px) {
  :root { --menu: 16px; }
  .ui { left: 12px; right: 12px; top: 10px; width: auto; }
  .title { font-size: clamp(56px, 19vw, 96px); }
  .menu { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 8px; }
  .btn { min-height: 48px; padding: .4em .5em .35em; gap: .4em; }
  .btn img { width: 1.25em; height: 1.25em; }
  .cheat { margin-top: 6px; grid-template-columns: 1fr; gap: 2px; }
  .cheat-h { display: none; }
  .field { min-height: 48px; padding: .1em .45em; }
  .ca { font-size: 16px; }
  .copy { justify-self: start; }
  .lore { font-size: 16px; margin-top: 6px; }
  .howto { display: none; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .title { font-size: clamp(48px, 15vw, 72px); }
  body[data-room="next"] .lore { display: none; }
}
@media (min-width: 761px) and (max-height: 800px) {
  .title { font-size: clamp(64px, 7.5vw, 130px); }
  :root { --menu: clamp(16px, 1.2vw, 22px); }
  .lore { font-size: 16px; }
}
