/* Departure Mono, the face the three games already use - one 22K file, no CDN. */
@font-face {
  font-family: 'Departure Mono';
  src: url('/font/DepartureMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #16111d;
  --panel: #221a2c;
  --panel-lit: #2b2137;
  --edge: #3a2f4a;
  --text: #e9e2f2;
  --dim: #9a8fab;
  --teal: #79c9b4;
  --teal-dim: #4aa48c;

  /* Telegram 8.0 hands back the notch and the header it draws over the page; both are zero in a browser. */
  --inset-top: 0px;
  --inset-bottom: 0px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Departure Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* A pull past the top of the shelf must not close the mini app, and must not bounce the page behind it. */
  overscroll-behavior-y: contain;
}

.shelf {
  /* Two cards a row at every width, so the shelf caps where two cards stop
     wanting to be wider rather than where the page does. */
  max-width: 620px;
  margin: 0 auto;
  padding:
    calc(20px + var(--inset-top) + env(safe-area-inset-top))
    calc(12px + env(safe-area-inset-right))
    calc(24px + var(--inset-bottom) + env(safe-area-inset-bottom))
    calc(12px + env(safe-area-inset-left));
}

/* Two per line from a 320px phone up. A one-up shelf put one game on a screen and
   the rest below the fold, which is the one thing a list of four games must not do. */
.games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--edge);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.card:hover,
.card:focus-within {
  border-color: var(--teal-dim);
  background: var(--panel-lit);
}

.card:active {
  transform: translateY(1px);
}

.face {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  flex: 1;
}

.art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  /* Every one of these is a screenshot of the game at its own pixel size. */
  image-rendering: pixelated;
  border-bottom: 1px solid var(--edge);
  background: var(--ink);
}

.body {
  padding: 8px 10px 6px;
}

.body h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--teal);
  display: flex;
  align-items: baseline;
  gap: 7px;
}

/* The one thing on a card that is not the name or the sentence: bet runs against
   other people in real time, and the shelf would otherwise not say so anywhere. */
.hot {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--teal);
  border: 1px solid #33564d;
  border-radius: 999px;
  padding: 1px 6px;
}

/* One sentence, and it is kept short enough to wrap to two lines in a half-width
   card on a 375px phone - which is what makes two cards on a row the same height
   without either of them being pinned to a height in here. */
.blurb {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--dim);
}

.meta {
  display: flex;
  align-items: center;
  padding: 0 10px 8px;
}

.link {
  margin-left: auto;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 3px 2px;
  cursor: pointer;
  text-decoration: none;
}

.link:hover,
.link:focus-visible {
  color: var(--teal);
}

.foot {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
}

.foot a {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--edge);
}

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

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

/* Telegram animates its own header in; a shelf that also animates arrives twice. */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

