/* BattlePens — the whole site's styling.
   Exercise-book paper on a desk, two biros and a pencil. Same palette as the
   game itself, so the site and the app look like the same hand made them. */

:root {
  --desk:   #2a2520;
  --paper:  #f1e9d2;
  --rule:   rgba(88, 127, 168, .28);
  --margin: rgba(181, 90, 78, .38);
  --pencil: #5c5850;
  --blue:   #23408e;
  --red:    #a53127;

  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
  --body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: clamp(12px, 4vw, 48px) clamp(8px, 3vw, 32px);
  background: var(--desk);
  /* A bit of grain on the desk, so it isn't a flat colour. */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.03), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.25), transparent 45%);
  color: var(--pencil);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
}

/* ------------------------------------------------------------- the sheet --- */

.sheet {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(28px, 7vw, 64px) clamp(20px, 6vw, 68px) clamp(36px, 8vw, 72px);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  background-position: 0 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 2px 0 rgba(0,0,0,.3);
  transform: rotate(-.22deg);
}

/* The printed red margin down the left. */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 clamp(14px, 5vw, 44px);
  width: 2px;
  background: var(--margin);
}

/* Thumbed corners. */
.sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 100% 100%, rgba(42,37,32,.16), transparent 9%),
    radial-gradient(circle at 0 0, rgba(42,37,32,.12), transparent 7%);
}

.sheet > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- type ---- */

header { text-align: center; }

.wordmark {
  display: block;
  width: min(100%, 620px);
  height: auto;
  margin: 0 auto;
  transform: rotate(.5deg);
}

.wordmark.small { width: min(100%, 320px); }

.tagline {
  font-family: var(--hand);
  color: var(--blue);
  font-size: clamp(1.05rem, 3.6vw, 1.35rem);
  line-height: 1.45;
  margin: .4em auto 0;
  max-width: 26ch;
  transform: rotate(-.5deg);
}

h1.page {
  font-family: var(--hand);
  color: var(--red);
  font-size: clamp(1.5rem, 5.5vw, 2rem);
  text-align: center;
  margin: .8em 0 0;
  transform: rotate(-.5deg);
}

h2 {
  font-family: var(--hand);
  color: var(--red);
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
  line-height: 1.3;
  margin: 2.1em 0 .5em;
  transform: rotate(-.4deg);
}

p { margin: 0 0 1.1em; }

.lead { font-size: clamp(1.05rem, 3.4vw, 1.2rem); margin-top: 1.6em; }

.dated {
  font-family: var(--hand);
  text-align: center;
  font-size: .95rem;
  margin-top: .3em;
}

strong { color: var(--blue); font-weight: 600; }

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

/* Underlined in biro, the way you'd emphasise something by hand. */
.scored {
  color: var(--red);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(165, 49, 39, .45);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

ul { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .5em; }

figure { margin: 1.6em 0 0; text-align: center; }
figure img { width: 100%; height: auto; max-width: 660px; }

figcaption {
  font-family: var(--hand);
  color: var(--pencil);
  font-size: .95rem;
  margin-top: .5em;
}

/* ----------------------------------------------------------------- how ---- */

ol.how { list-style: none; counter-reset: step; margin: 1.2em 0 0; padding: 0; }

ol.how li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6em;
  margin-bottom: .9em;
}

ol.how li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.05em;
  width: 1.75em;
  height: 1.75em;
  display: grid;
  place-items: center;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 50% 48% 52% 50%;
  transform: rotate(-4deg);
}

/* ------------------------------------------------------------ the sticker -- */

.note {
  background: linear-gradient(#f9e88c, #efd669);
  color: #34405f;
  font-family: var(--hand);
  padding: 1.1em 1.3em;
  margin: 2.4em 0 0;
  max-width: 34ch;
  transform: rotate(1.4deg);
  box-shadow: 4px 9px 18px rgba(0,0,0,.35);
}

.note p { margin: 0; }

/* --------------------------------------------------------------- get it ---- */

.get { margin: 2.6em 0 0; text-align: center; }

.get img {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}

.play {
  display: inline-block;
  margin-top: 1.1em;
  padding: .75em 1.6em;
  background: var(--blue);
  color: var(--paper);
  font-family: var(--hand);
  font-size: 1.15rem;
  text-decoration: none;
  border-radius: 3px;
  transform: rotate(-.7deg);
  box-shadow: 3px 4px 0 rgba(35,64,142,.35);
}

.play:hover, .play:focus-visible { background: #1b3272; }

.platform {
  font-family: var(--hand);
  font-size: .95rem;
  margin-top: .9em;
  color: var(--pencil);
}

/* --------------------------------------------------------------- footer ---- */

footer {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: 1px solid rgba(92,88,80,.25);
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4em 1.4em;
  justify-content: space-between;
}

@media (prefers-reduced-motion: no-preference) {
  .play { transition: background .15s ease; }
}
