/* Aiwee Games: shared pixel-art look of the hub, sign-in and privacy pages.
   Colours are the games' palette (games/crowd/assets-src/pixel/export/palette/crowd32.gpl);
   every image under /assets/ is built by games/hub/build.sh. Images are shown at whole
   multiples of their size (x2, backdrop and logo x3 on wide screens) and never smoothed. */
@font-face {
  font-family: "Jersey 25"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/Jersey25-latin.woff") format("woff");
}
:root {
  --ink: #1a1030; --dark: #3b3356; --mid: #6f6a90; --light: #b3b1cc; --white: #f6f4ff;
  --yellow2: #ffd23f; --yellow3: #fff3a6; --green2: #46bb4c; --green3: #b0ef6a; --teal2: #25b7b4;
  --blue2: #4385f5; --purple2: #9157e8; --purple3: #d2b2ff; --orange2: #f7862f;
  --pixel: "Jersey 25", "Trebuchet MS", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --s: 2;        /* backdrop scale */
  --g: 44px;     /* height of the grass strip under the hills */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: 20px 16px 28px; color: var(--ink); background: var(--blue2);
  font-family: var(--text); font-size: 1rem; line-height: 1.5;
}
img, .px { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }
[hidden] { display: none !important; }

/* parallax backdrop: sky, far ridge and near hills drift at different speeds */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--blue2); pointer-events: none; }
.backdrop i {
  position: absolute; left: 0; bottom: calc(var(--g) - 63px * var(--s));
  width: calc(100% + 480px * var(--s)); height: calc(270px * var(--s));
  background: repeat-x 0 0 / calc(480px * var(--s)) 100%; image-rendering: pixelated;
  animation: drift 240s linear infinite; will-change: transform;
}
.backdrop .sky { background-image: url("bg_sky.png"); }
.backdrop .far { background-image: url("bg_far.png"); animation-duration: 150s; }
.backdrop .near { background-image: url("bg_near.png"); animation-duration: 80s; }
.backdrop b { position: absolute; left: 0; right: 0; bottom: 0; height: var(--g); background: var(--green2); }
@keyframes drift { to { transform: translateX(calc(-480px * var(--s))); } }

/* 9-slice panels and buttons from the games' UI kit (PNG already at x2) */
.panel, .panel-dark { border: 12px solid transparent; border-image: url("panel_light.png") 12 fill / 12px stretch; }
.panel-dark { border-image-source: url("panel_dark.png"); color: var(--white); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px;
  padding: 0 8px; margin: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 400 1.625rem/1 var(--pixel); letter-spacing: .02em; color: var(--ink); background: none;
  border: solid transparent; border-width: 12px 12px 16px;
  border-image: url("btn_yellow.png") 12 12 16 fill / 12px 12px 16px stretch;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { border-width: 16px 12px 12px; border-image: url("btn_yellow_pressed.png") 16 12 12 fill / 16px 12px 12px stretch; filter: none; }
.btn.white { border-image-source: url("btn_white.png"); }
.btn.white:active { border-image-source: url("btn_white_pressed.png"); }
.btn.purple { border-image-source: url("btn_purple.png"); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.purple:active { border-image-source: url("btn_purple_pressed.png"); }
.btn.off, .btn.off:active {
  border-width: 12px 12px 16px; border-image: url("btn_grey.png") 12 12 16 fill / 12px 12px 16px stretch;
  color: var(--dark); cursor: default; filter: none;
}
.btn.small { min-height: 46px; font-size: 1.4rem; }
.btn img { flex: none; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--yellow2); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ink);
}

.tag {
  display: inline-block; padding: 2px 8px 3px; font: 400 1.25rem/1 var(--pixel); letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink); background: var(--green3);
  border: 2px solid var(--ink); box-shadow: inset 0 -2px 0 rgba(26, 16, 48, .25), 2px 2px 0 var(--ink);
}
.tag.exp { background: var(--purple3); }
.tag.proto { background: var(--yellow2); }
.tag.soon { background: var(--light); }

/* idle blips: 4 frames across, one row per colour (set --c to the row, 0 = red ... 7 = pink) */
.blip {
  display: block; width: 40px; height: 40px; image-rendering: pixelated;
  background: url("blips_idle.png") 0 calc(-40px * var(--c, 5)) / 160px 320px;
  animation: blip .88s steps(4) infinite;
}
.blip.flip { transform: scaleX(-1); }
@keyframes blip { to { background-position-x: -160px; } }
.blips { position: absolute; bottom: 100%; right: 10px; display: flex; gap: 2px; margin-bottom: 10px; pointer-events: none; }
.blips .blip:nth-child(2) { animation-delay: -.3s; }
.blips .blip:nth-child(3) { animation-delay: -.55s; }

.logo { display: block; width: 284px; height: 44px; max-width: 100%; }
h1 { margin: 0; line-height: 0; }
a { color: inherit; }

/* hub ---------------------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1104px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 14px; }
.account { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 0 4px; font: 400 1.5rem/1.1 var(--pixel); }
.account a, .account button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font: inherit; color: var(--yellow3);
  background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.account form { margin: 0; }
.account #who { padding-left: 6px; overflow-wrap: anywhere; }
.intro { position: relative; margin: 44px 0 22px; padding: 4px 8px 6px; font: 400 1.5rem/1.2 var(--pixel); letter-spacing: .01em; }
.intro p { margin: 0; }
.about { margin-top: 4px; font-size: .75em; }
.about summary { cursor: pointer; width: max-content; padding: 6px 2px; color: var(--yellow3); text-decoration: underline; list-style: none; }
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: " +"; }
.about[open] summary::after { content: " -"; }
.about p { margin-top: 6px; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px 18px; justify-items: center; align-items: stretch; }
.game { width: 100%; max-width: 456px; display: flex; flex-direction: column; }
.art { position: relative; height: 208px; overflow: hidden; border: 2px solid var(--ink); background: var(--blue2); }
.art i {
  position: absolute; top: 0; left: 50%; width: 432px; height: 208px; margin-left: -216px; image-rendering: pixelated;
  background: 0 0 / 5184px 208px; animation: key 2.16s steps(12) infinite;
}
.art.shooter i { background-image: url("key_shooter.png"); }
.art.retro i { background-image: url("key_retro.png"); animation-delay: -.9s; }
.art.crowd i { background-image: url("key_crowd.png"); }
.art.skirmish i { background-image: url("key_skirmish.png"); animation: none; }
.art.surv i { background-image: url("key_surv.png"); background-size: 432px 208px; animation: none; }
.art.liminal i { background: url("key_liminal.png") 0 0 / 432px 208px; animation: none; }
@keyframes key { to { background-position-x: -5184px; } }
.art .tag { position: absolute; left: 8px; top: 8px; }
.tag.dev { background: var(--yellow2); }
.art .tag.dev { left: auto; right: 8px; }
.game.soon .art i { animation: none; filter: grayscale(.85) brightness(.9); }
.game .body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 12px 6px 4px; }
h2 { margin: 0; font: 400 1.875rem/1 var(--pixel); letter-spacing: .02em; text-transform: uppercase; }
.game p { margin: 0; flex: 1; color: var(--dark); }
footer { margin-top: 26px; align-self: flex-start; display: flex; flex-wrap: wrap; gap: 0 14px; padding: 0 4px; font: 400 1.4rem/1.1 var(--pixel); }
footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--yellow3); text-underline-offset: 3px; }

/* sign-in ------------------------------------------------------------------------------------- */
body.center { align-items: center; justify-content: center; padding-top: 64px; }
.card { position: relative; width: 100%; max-width: 440px; padding: 12px 8px 8px; }
.card .tag { margin: 14px 0 16px; }
.card p { margin: 0 0 16px; }
.card .btn { margin: 0 0 12px; }
.card form { margin: 0; }
.note { font-size: .92rem; color: var(--dark); }
.card .note { margin: 4px 0 0; }
.note a, .doc a { font-weight: 700; text-underline-offset: 2px; }
.note a { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
.who { font-weight: 700; overflow-wrap: anywhere; }

/* privacy -------------------------------------------------------------------------------------- */
.doc { position: relative; width: 100%; max-width: 720px; margin: 44px auto 0; padding: 10px 10px 12px; }
.doc h1 { font: 400 2.8125rem/1 var(--pixel); letter-spacing: .02em; text-transform: uppercase; margin: 0 0 6px; }
.doc h2 {
  display: inline-block; margin: 22px 0 8px; padding: 3px 10px 4px; font: 400 1.5rem/1 var(--pixel); letter-spacing: .03em;
  text-transform: uppercase; background: var(--teal2); border: 2px solid var(--ink);
  box-shadow: inset 0 -2px 0 rgba(26, 16, 48, .25), 2px 2px 0 var(--ink);
}
.doc p { margin: 8px 0; }
.doc ul { padding-left: 1.25em; margin: 6px 0; }
.doc li { margin: 3px 0; }
.doc li::marker { content: "\25AA\00A0"; color: var(--teal2); }
.doc code { font-size: .92em; padding: 1px 5px; background: #e4e1f5; border: 1px solid var(--light); }
.doc .meta { color: var(--dark); margin: 0 0 10px; }
.doc .btn { width: auto; display: inline-flex; margin-top: 20px; padding: 0 14px; }

@media (min-width: 900px) {
  :root { --s: 3; --g: 70px; }
  body { padding-top: 28px; }
  .logo { width: 426px; height: 66px; }
  .card .logo { width: 284px; height: 44px; }
}
@media (max-width: 400px) {
  .card .btn { font-size: 1.45rem; gap: 8px; padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .backdrop i, .blip, .art i { animation: none; }
}
