/* The web's pages (DS-080): the game's palette (game/ui/palette.gd) and its one font (Fusion Pixel, OFL, subset to
   Latin and Cyrillic), drawn at whole multiples of its 10 px grid; pictures at whole multiples of their pixels. */
@font-face {
  font-family: "Fusion Pixel";
  src: url("font/fusion-pixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #1b1b2a;
  --void-night: #140f22;
  --void-deep: #2a2140;
  --void: #4a3560;
  --panel: #1c1b26;
  --panel-light: #34324a;
  --border: #0f0e18;
  --text: #e8e2cf;
  --dim: #8d8899;
  --gold: #e2b347;
  --gem: #4fc3f7;
  --ember: #e0662a;
  --ember-dark: #8c2a1e;
  --ember-light: #ffd27a;
  --danger: #e04a3a;
  --rare: #5fb04a;
  --super-rare: #4a86d8;
  --epic: #9a58c8;
  --common: #9a948c;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--void-night);
  color: var(--text);
  font-family: "Fusion Pixel", ui-monospace, monospace;
  font-size: 20px;
  line-height: 30px;
  -webkit-font-smoothing: none;
  font-smooth: never;
  min-height: 100vh;
}
/* the void behind every page, one screen tall and still while the page scrolls: a layer of its own, since a fixed
   background is drawn as a scrolling one on iOS and ends in a hard line under a long page elsewhere (DS-310) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--void-night) 0, var(--void-deep) 60%, var(--void) 100%);
}

img, .px { image-rendering: pixelated; image-rendering: crisp-edges; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.page { max-width: 720px; margin: 0 auto; padding: 16px; }

/* the header every page shares (DS-310: one nav, written by pages.py on the static pages and by web.js on the
   scripted ones): the name, then Blog, Drop chances and Profile, each a 40 px tap; under 600 px the nav is a row of
   its own */
header.top {
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  padding: 4px 0 16px; position: relative; z-index: 2;
}
header.top .brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 20px; min-height: 40px; }
header.top .brand:hover { text-decoration: none; }
header.top .brand img { width: 32px; height: 32px; }
header.top nav { margin-left: auto; display: flex; align-items: center; gap: 0 20px; flex-wrap: wrap; }
header.top nav a { color: var(--dim); display: inline-flex; align-items: center; min-height: 40px; }
header.top nav a:hover { color: var(--text); text-decoration: none; }
header.top nav a.here { color: var(--text); box-shadow: inset 0 -2px 0 var(--ember); }
header.top nav a.me { color: var(--gold); padding: 0 10px; border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--panel-light); background: var(--panel); }
header.top nav a.me.here { box-shadow: inset 0 0 0 2px var(--ember); color: var(--text); }
header.top nav a.me img { width: 20px; height: 20px; margin-right: 8px; }
.lang { font-size: 10px; line-height: 20px; color: var(--dim); }
.lang a { color: var(--dim); margin-left: 6px; display: inline-block; padding: 10px 0; }
.lang a.here { color: var(--text); }
@media (max-width: 599px) {
  header.top nav { order: 3; margin-left: 0; width: 100%; gap: 0 24px; }
  header.top nav a.me { margin-left: auto; }
  header.top .lang { order: 2; margin-left: auto; }
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--panel); padding: 4px 10px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

h1 { font-size: 40px; line-height: 50px; font-weight: normal; margin: 8px 0 12px; text-wrap: balance; }
h2 { font-size: 20px; line-height: 30px; font-weight: normal; color: var(--gold); margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.dim { color: var(--dim); }
.small { font-size: 10px; line-height: 20px; }
.gold { color: var(--gold); }
.warn { color: var(--ember-light); }
.bad { color: var(--danger); }

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: inset 0 0 0 2px var(--panel-light);
  padding: 12px;
  margin: 0 0 12px;
}
.panel.gold { box-shadow: inset 0 0 0 2px var(--gold); color: inherit; }

/* a baked icon strip (`assets/icons/<name>_32.png`: 32 px frames side by side), drawn at 2x and looped */
.icon {
  display: inline-block; width: 64px; height: 64px; flex: none;
  background-repeat: no-repeat; background-size: auto 64px; image-rendering: pixelated;
  animation: strip 1.5s steps(var(--frames, 12)) infinite;
}
.icon.s { width: 32px; height: 32px; background-size: auto 32px; animation-name: strip-s; }
@keyframes strip { from { background-position: 0 0; } to { background-position: calc(-64px * var(--frames, 12)) 0; } }
@keyframes strip-s { from { background-position: 0 0; } to { background-position: calc(-32px * var(--frames, 12)) 0; } }
@media (prefers-reduced-motion: reduce) { .icon { animation: none; } }

button, .button {
  font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel-light); border: 2px solid var(--border); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35);
  padding: 6px 16px; min-height: 44px;
}
button.primary { background: var(--ember-dark); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 2px var(--ember); }
button:disabled { opacity: 0.45; cursor: default; }
button:not(:disabled):active { transform: translateY(2px); box-shadow: none; }

input[type=text], input[type=email], input[type=password] {
  font: inherit; color: var(--text); background: var(--ink);
  border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--panel-light);
  padding: 6px 10px; min-height: 44px; width: 100%;
}
input[type=text]::placeholder, input[type=email]::placeholder, input[type=password]::placeholder { color: var(--dim); }
label { display: block; color: var(--dim); font-size: 10px; line-height: 20px; margin: 0 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; min-width: 0; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: normal; color: var(--dim); font-size: 10px; line-height: 20px; padding: 0 8px 4px 0; }
td { padding: 6px 8px 6px 0; vertical-align: middle; border-top: 2px solid var(--border); }
td.num, th.num { text-align: right; white-space: nowrap; padding-left: 12px; padding-right: 0; }
td:last-child, th:last-child { padding-right: 0; }

/* a chance as a bar under its row's outcome */
.bar { height: 4px; background: var(--ink); margin-top: 4px; }
.bar > i { display: block; height: 4px; background: var(--gold); }

.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.offer { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin: 0; }
.offer .n { font-size: 20px; }
.offer .was { color: var(--dim); font-size: 10px; line-height: 20px; text-decoration: line-through; }
.offer button { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat { margin: 0; }
.stat .v { font-size: 40px; line-height: 50px; }
.stats + p { margin-top: 12px; }

/* the footer every page shares (DS-310): the site's pages, then the studio and the font's credit; each link a 40 px
   tap */
footer { margin: 32px 0 16px; padding-top: 8px; border-top: 2px solid var(--border); font-size: 10px; line-height: 20px; color: var(--dim); }
footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
footer nav a { color: var(--dim); display: inline-block; padding: 10px 0; }
footer nav a:hover { color: var(--text); }
footer p { margin: 4px 0 0; }
footer p a { color: var(--dim); text-decoration: underline; }

.nowrap { white-space: nowrap; }

.hidden { display: none !important; }

/* a legal page (privacy, terms, delete-account, legal: DS-249): long text, lists, a word marked by colour (the font
   has one weight) */
.legal ul { margin: 0 0 12px; padding-left: 24px; }
.legal li { margin: 0 0 8px; }
.legal b { font-weight: normal; color: var(--ember-light); }

/* a hero's face (DS-310, `Web.face`): an 8-frame strip of 64 px, painted on a canvas, looped at a whole multiple */
.face { display: inline-block; flex: none; background-repeat: no-repeat; image-rendering: pixelated;
  animation: face 2s steps(8) infinite; }
@keyframes face { from { background-position: 0 0; } to { background-position: calc(-8 * var(--w, 64px)) 0; } }
@media (prefers-reduced-motion: reduce) { .face { animation: none; } }

/* a row of jumps to a long page's parts (DS-310: the drop chances are many screens long on a phone) */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; font-size: 10px; line-height: 20px;
  color: var(--text); background: var(--panel); border: 2px solid var(--border); box-shadow: inset 0 0 0 2px var(--panel-light); }
.jump a:hover { text-decoration: none; box-shadow: inset 0 0 0 2px var(--gold); }
h2[id] { scroll-margin-top: 16px; }
