/* Project Trail playtest site: one look for the playtest page, the password
   page and the downloads (Server/Web writes those). Dusk over a campfire,
   the game's gold and ember. The fonts lie next to it (OFL, fonts/). */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #1c1410;
  --dusk: #3a2740;
  --text: #e9dcc4;
  --parchment: #d8c49e;
  --muted: #a8957a;
  --faint: #7d6a55;
  --gold: #c9a24a;
  --gold-deep: #a67c3a;
  --title: #f5b451;
  --title-shadow: #6b3a12;
  --ember: #f58a3c;
  --ember-light: #ff9d52;
  --ink: #2a1608;
  --card: #2e2118;
  --field: #1e1510;
  --field-line: #4a3626;
  --error: #e8866a;
  --link: #f0a24a;
  --link-light: #ffc27a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* What the script hides stays hidden, whatever display it has otherwise. */
[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, var(--dusk) 0%, var(--bg) 60%) no-repeat var(--bg);
  color: var(--text);
  font: 14px/1.5 "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-light);
}

:focus-visible {
  outline: 2px solid var(--title);
  outline-offset: 2px;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 72px 16px 40px;
}

/* The title, the game's logo in letters */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  text-align: center;
}

.title {
  margin: 0;
  font-family: "Pixelify Sans", monospace;
  font-weight: 700;
  font-size: clamp(36px, 9vw, 76px);
  line-height: 1.05;
  letter-spacing: 2px;
  color: var(--title);
  text-shadow: 0 3px 0 var(--title-shadow), 0 0 24px rgba(245, 140, 50, 0.35);
  text-decoration: none;
}

a.title:hover {
  color: var(--title);
}

.masthead-small {
  margin-bottom: 32px;
}

.masthead-small .title {
  font-size: clamp(32px, 6vw, 48px);
}

.motto {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  color: var(--parchment);
}

.rule {
  width: 60px;
  height: 1px;
  background: var(--gold);
}

/* The playtest page's two cards, side by side and on a phone one under the
   other: the download on the left, the registration on the right. */

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  width: 100%;
  max-width: 760px;
}

/* Both as tall as the registration: the download card keeps to a few
   lines, what is longer folds away under "How to start it". */
.boards .card {
  max-width: none;
}

.version {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--field-line);
  font-size: 12px;
  color: var(--muted);
}

.info p {
  margin: 0;
  text-wrap: pretty;
}

.how summary {
  cursor: pointer;
  color: var(--link);
}

.how summary:hover {
  color: var(--link-hover, var(--link));
}

.how[open] summary {
  margin-bottom: 8px;
}

.starts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.starts li {
  padding: 8px 10px;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 3px;
  text-wrap: pretty;
}

.starts li.mine {
  border-color: var(--gold-deep);
  color: var(--parchment);
}

.starts b {
  color: var(--text);
  font-weight: 500;
}

/* The card: registration, welcome, password */

.card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 28px 24px;
  background: var(--card);
  border: 2px solid var(--gold-deep);
  border-radius: 4px;
  box-shadow: 0 0 0 1px #000, 0 16px 48px rgba(0, 0, 0, 0.45);
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--link);
  text-align: center;
}

.card form,
.welcome {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input {
  width: 100%;
  padding: 10px;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 3px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--gold);
}

input::placeholder {
  color: var(--faint);
}

.error {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: var(--error);
}

.button {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--ember);
  border: none;
  border-radius: 3px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--ember-light);
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.welcome {
  padding: 16px 0;
  text-align: center;
}

.welcome .card-title {
  font-size: 16px;
  color: var(--text);
  outline: none;
}

.muted {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-wrap: pretty;
}

.others {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.others:empty {
  display: none;
}

code {
  font-family: inherit;
  color: var(--title);
  overflow-wrap: break-word;
}

/* A small line under a card: the downloads page's way back */

.quick {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.quick a {
  color: var(--muted);
}

.quick a:hover {
  color: var(--link);
}

/* The pictures, framed the way the game frames its slots */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin-top: 48px;
}

.shots a {
  display: block;
  border: 1px solid #5a4424;
  box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.15s;
}

.shots a:hover {
  border-color: var(--gold);
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
}

.footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* The downloads */

.listing {
  max-width: 560px;
}

.version + .version {
  padding-top: 12px;
  border-top: 1px solid var(--field-line);
}

.version h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.tag {
  padding: 0 6px;
  background: var(--gold);
  border-radius: 2px;
  color: var(--ink);
  font-size: 11px;
}

.date {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.files li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.file-name {
  color: var(--faint);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.size {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.notes {
  width: 100%;
  max-width: 560px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.notes p {
  margin: 8px 0;
  text-wrap: pretty;
}

.notes b {
  color: var(--text);
  font-weight: 500;
}

/* Embers rising from the bottom, the splash card's */

.embers {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.embers i {
  position: absolute;
  bottom: -8px;
  width: 3px;
  height: 3px;
  background: #ffb347;
  box-shadow: 0 0 6px 2px rgba(255, 140, 50, 0.55);
  opacity: 0;
  animation: rise 12s linear infinite;
}

.embers i:nth-child(1) { left: 6%; animation-duration: 13s; animation-delay: -1s; --drift: 40px; }
.embers i:nth-child(2) { left: 14%; animation-duration: 10s; animation-delay: -6s; --drift: -20px; }
.embers i:nth-child(3) { left: 23%; animation-duration: 15s; animation-delay: -3s; --drift: 30px; }
.embers i:nth-child(4) { left: 31%; animation-duration: 11s; animation-delay: -9s; --drift: -35px; }
.embers i:nth-child(5) { left: 42%; animation-duration: 14s; animation-delay: -4s; --drift: 25px; }
.embers i:nth-child(6) { left: 51%; animation-duration: 12s; animation-delay: -11s; --drift: -15px; }
.embers i:nth-child(7) { left: 60%; animation-duration: 16s; animation-delay: -7s; --drift: 45px; }
.embers i:nth-child(8) { left: 68%; animation-duration: 10s; animation-delay: -2s; --drift: -30px; }
.embers i:nth-child(9) { left: 77%; animation-duration: 13s; animation-delay: -10s; --drift: 20px; }
.embers i:nth-child(10) { left: 85%; animation-duration: 11s; animation-delay: -5s; --drift: -40px; }
.embers i:nth-child(11) { left: 93%; animation-duration: 15s; animation-delay: -8s; --drift: 15px; }
.embers i:nth-child(12) { left: 37%; animation-duration: 17s; animation-delay: -13s; --drift: -25px; }

@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.9; }
  60% { opacity: 0.5; }
  100% { transform: translate(var(--drift, 30px), -96vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .embers {
    display: none;
  }
}

@media (max-width: 480px) {
  .page {
    padding-top: 48px;
  }

  .masthead {
    margin-bottom: 32px;
  }

  .card {
    padding: 24px 18px;
  }
}
