/* wrongmove.dev — full-viewport ASCII water; the logo and text sit in a 16:9-max stage. See DESIGN.md (v3). */

@font-face {
  font-family: "Tiny5";
  src: url("fonts/Tiny5.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #bdbdbd;
  --dim: #6c6c6c;
  --dimmer: #4a4a4a;
  --hi: #e2d24a;
  --olive: #b09a5c;
  --margin: 24px;
  --fs: 20px;        /* Tiny5 is a 5 px design: keep sizes at multiples of 5 */
  --fs-name: 40px;
  --logo-w: 31.7%;   /* banner proportion: 475 / 1500 */
  --waterline: 46%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #2a2a2a;   /* the charcoal ground; the canvas covers the whole viewport */
  color: var(--text);
  font-family: "Tiny5", ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs);
  line-height: 1.2;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow: hidden;
}

/* the stage never gets wider than 16:9; it is the full viewport otherwise */
#stage {
  position: relative;
  height: 100vh;
  height: 100dvh;                 /* the real visible height on mobile (address bar collapsed or not) */
  width: min(100vw, 177.78vh);
  width: min(100vw, 177.78dvh);
  margin: 0 auto;
  overflow: hidden;
}

/* the water is behind everything, over the full viewport (no bars on ultrawide) */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;                   /* fallback only: scene.js sets the exact px size of the visible viewport, */
  height: 100vh;                  /* so the bitmap maps 1:scale to css px and nothing stretches */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* CSS fallback positions (scene.js overrides them with exact pixels) */
.logo {
  position: absolute;
  left: 50%;
  width: var(--logo-w);
  margin: 0;
  transform: translateX(-50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
#logo-w { bottom: calc(100% - var(--waterline) + 0.5%); }

.name {
  font-size: var(--fs-name);
  font-weight: 400;
  line-height: 1;
  color: #fff;
  margin: 0 0 .15em;
  white-space: nowrap;
}

.hud { position: absolute; pointer-events: none; }
.hud a { pointer-events: auto; }

.bottom {
  left: var(--margin);
  right: var(--margin);
  bottom: calc(var(--margin) + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2em;
}

.player { max-width: 30em; }
.tag { margin: 0; }
.dim { color: var(--dim); }
.copy { margin: 1.2em 0 0; }

.legend { display: flex; flex-direction: column; align-items: flex-end; }
.legend .row {
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.legend .row.dim { color: var(--dim); }
.legend .soon { color: var(--dimmer); margin-left: .5em; }
.legend a:hover, .legend a:focus-visible { color: var(--hi); outline: none; }

/* pointer slot: fixed width so the row never shifts when the triangle appears */
.menu .h { color: var(--dim); margin-bottom: .2em; }
.pt { display: inline-block; width: 1em; height: .6em; position: relative; }
.pt svg { position: absolute; left: 0; bottom: 0; width: .6em; height: .6em; fill: var(--hi); visibility: hidden; }
.legend a:hover .pt svg, .legend a:focus-visible .pt svg { visibility: visible; }
.k { color: var(--olive); }
.legend a:hover .k, .legend a:focus-visible .k { color: var(--hi); }

@media (max-width: 700px), (max-aspect-ratio: 1/1) {
  :root { --fs: 15px; --fs-name: 30px; --margin: 16px; --logo-w: 70%; --waterline: 42%; }
  .bottom { flex-direction: column; align-items: flex-start; gap: 1.5em; }
  .legend { align-items: flex-start; }
  .copy { display: none; }
}
