/* BalenaScape website.
   The palette and the two type families come from the game's own interface (client/style.css): brown stone panels
   with bevelled edges, orange Tahoma text with a one-pixel black shadow, parchment scrolls, and the gold-and-sea coin.
   Stone = interface, parchment = documents (news, rules, privacy), gold = the coin (logo, Play now, step numbers).
   Works under: default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'self'. */

:root {
  /* stone (game panels) */
  --night: #16120d;
  --stone: #3e3529;
  --stone-deep: #1d1913;
  --hi: #6b5c47;
  --lo: #0f0d09;
  /* text */
  --text: #e8d8b8;
  --muted: #c4b494;
  --orange: #ff981f;
  --orange-hover: #ffb347;
  --yellow: #ffff00;
  --label: #ffcf8f;
  --focus: #ffd84a;
  /* gold coin */
  --gold-ink: #231203;
  --gold-light: #fff4b0;
  --gold: #f0b830;
  /* parchment */
  --parch: #f1e2b8;
  --rubric: #6a2c0c;
  --ink: #2a1c0c;
  --ink-soft: #54401f;
  --blue-ink: #0f1a78;
  /* sea */
  --sea: #0b2138;

  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, 'URW Palladio L', P052, 'TeX Gyre Pagella', Georgia, serif;
  --ui: Tahoma, Verdana, 'Segoe UI', 'DejaVu Sans', sans-serif;
  --mono: Consolas, 'Cascadia Mono', Menlo, 'DejaVu Sans Mono', monospace;

  --wrap: 75rem;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 60px;
  --section: clamp(4rem, 3rem + 5vw, 8rem);

  /* stone grain: a fine black speckle with a little alpha; paper grain: soft brown clouds. Both tile seamlessly
     (the filter region is exactly the tile, and baseFrequency x tile size is a whole number). */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .3 -.05'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .38 -.1'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E");
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='18' viewBox='0 0 96 18'%3E%3Cpath d='M0 9 Q12 1 24 9 T48 9 T72 9 T96 9 V18 H0 Z' fill='%230b2138'/%3E%3Cpath d='M0 9 Q12 1 24 9 T48 9 T72 9 T96 9' fill='none' stroke='%236fb8e8' stroke-opacity='.55' stroke-width='1.5'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--night);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* big monitors: everything a little larger, so the page keeps its proportions */
@media (min-width: 1800px) { html { font-size: 112.5%; } }
@media (min-width: 2300px) { html { font-size: 125%; } }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--night);
  background-image: var(--grain);
  color: var(--text);
  font: 400 1.125rem/1.65 var(--serif);
  font-kerning: normal;
}
main { flex: 1 0 auto; }
@media (max-width: 499px) { body { font-size: 1.0625rem; } }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.15; text-wrap: balance; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
a { color: var(--orange); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--orange-hover); }
strong { color: var(--label); font-weight: 700; }
em { font-style: italic; }
code {
  font-family: var(--mono);
  font-size: .88em;
  color: #ffd890;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(0, 0, 0, .5);
  border-radius: 3px;
  padding: .05em .35em;
  white-space: nowrap;
}
kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: .1em .45em .15em;
  font: 700 .8125rem/1.3 var(--ui);
  color: var(--orange);
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  background: linear-gradient(#524536, #372e23);
  border: 1px solid #16120d;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .13), 0 2px 0 #0f0d09;
  vertical-align: .1em;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: #7c2f1c; color: #fff; }

/* the hidden attribute wins over any display a class sets (register.js switches the sign-up states with it) */
[hidden] { display: none !important; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  font: 700 1rem/1 var(--ui);
  color: var(--gold-ink);
  background: var(--gold);
  border-radius: 3px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--gold-ink); }

/* ------------------------------------------------------------------ interface pieces (as in the game) */
.panel {
  background-color: var(--stone);
  background-image: var(--grain);
  border: 2px solid var(--stone-deep);
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 var(--hi), inset -1px -1px 0 var(--lo), 0 6px 22px rgba(0, 0, 0, .55);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: 10px 22px;
  font: 700 1.0625rem/1.2 var(--ui);
  color: var(--orange);
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px 0 #000;
  background: linear-gradient(#524536, #372e23);
  border: 1px solid #16120d;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .13), inset -1px -1px 0 rgba(0, 0, 0, .35), 0 3px 10px rgba(0, 0, 0, .45);
  cursor: pointer;
}
.btn:hover { color: var(--orange-hover); background: linear-gradient(#5f5040, #43392b); }
.btn:active { box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .6); }
/* the gold of the game's logo lettering */
.btn-gold {
  color: var(--gold-ink);
  text-shadow: 0 1px 0 rgba(255, 248, 208, .55);
  background: linear-gradient(#fff8d0, #ffd84a 30%, #d99a18 52%, #ffcc3a 72%, #b87a10);
  border-color: #2a1604;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(90, 50, 5, .4), 0 0 0 1px rgba(255, 216, 74, .22), 0 4px 16px rgba(0, 0, 0, .55);
}
.btn-gold:hover { color: var(--gold-ink); background: linear-gradient(#fffbe4, #ffe070 30%, #e8aa26 52%, #ffd65a 72%, #c88a18); }
.btn-gold:active { box-shadow: inset 0 2px 4px rgba(90, 50, 5, .6); }
.btn-lg { min-height: 56px; padding: 12px 34px; font-size: 1.25rem; }
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: .9375rem; }

/* a screenshot in a stone frame, like the game's own panels; links to the full-size picture */
.shot {
  display: block;
  padding: 5px;
  background-color: var(--stone);
  background-image: var(--grain);
  border: 1px solid var(--lo);
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 var(--hi), inset -1px -1px 0 var(--lo), 0 10px 26px rgba(0, 0, 0, .55);
  cursor: zoom-in;
}
.shot img { width: 100%; border: 1px solid #0a0806; border-radius: 1px; background: var(--stone-deep); }
.shot:hover { background-color: #54483a; }
.shot:hover img { filter: brightness(1.07); }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--stone);
  background-image: var(--grain), linear-gradient(#4a3f31, #332b21);
  border-bottom: 2px solid var(--lo);
  box-shadow: inset 0 1px 0 var(--hi), 0 4px 16px rgba(0, 0, 0, .55);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font: 700 1.375rem/1 var(--serif);
  color: #f5c542;
  text-decoration: none;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: .01em;
}
.brand:hover { color: var(--gold-light); }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 24px; list-style: none; }
.site-nav a {
  display: inline-block;
  padding: 10px 0;
  font: 400 .9375rem/1.2 var(--ui);
  color: var(--orange);
  text-decoration: none;
  text-shadow: 1px 1px 0 #000;
}
.site-nav a:hover { color: var(--yellow); }
.site-nav a[aria-current="page"] { color: var(--yellow); }
.nav-toggle { display: none; }
/* 860-1023 px: six menu items, the brand and Play now still fit on one line */
@media (min-width: 860px) and (max-width: 1023px) {
  .header-inner { column-gap: 18px; }
  .site-nav ul { gap: 0 15px; }
  .site-nav a { font-size: .875rem; }
}

@media (max-width: 859px) {
  .site-header { position: relative; }
  .header-play { order: 2; }
  .site-nav { order: 4; flex-basis: 100%; margin-top: -6px; padding-bottom: 6px; }
  .site-nav ul { gap: 0 18px; }
}
/* with JavaScript on a narrow screen: a compact sticky bar with a Menu button (site.js opens it) */
@media (max-width: 859px) and (scripting: enabled) {
  .site-header { position: sticky; }
  .nav-toggle { display: inline-flex; order: 3; }
  .nav-toggle::before {
    content: '';
    width: 16px;
    height: 12px;
    background: linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat;
    filter: drop-shadow(1px 1px 0 #000);
  }
  .nav-toggle[aria-expanded="true"] { color: var(--yellow); background: linear-gradient(#7c2f1c, #4c1b0f); border-color: #1c0804; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    margin: 2px 0 0;
    padding: 8px var(--gutter) 14px;
    background-color: var(--stone);
    background-image: var(--grain), linear-gradient(#3e3529, #2f281f);
    border-bottom: 2px solid var(--lo);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .6);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li + li { border-top: 1px solid rgba(0, 0, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
  .site-nav a { display: block; padding: 14px 4px; font-size: 1.0625rem; }
}
@media (max-width: 400px) {
  .brand { font-size: 1.125rem; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .header-inner { gap: 8px 10px; }
  .header-play { padding-inline: 12px; }
  /* just the three bars on the smallest phones; the word stays for screen readers */
  .nav-toggle { width: 44px; padding: 0; }
  .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ------------------------------------------------------------------ hero: the game's login screen, on the docks */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: max(min(calc(100svh - var(--header-h) - 4rem), 56.25vw), min(88svh, 720px));
  min-height: 520px;
  overflow: hidden;
  background: #9fc3d6;
}
.hero-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* dusk over the empty sky, so the lettering reads; the bottom fades into the page */
.hero::before {
  background:
    radial-gradient(ellipse 60% 55% at 50% 22%, rgba(22, 18, 13, .5), rgba(22, 18, 13, 0) 70%),
    linear-gradient(rgba(22, 18, 13, .78), rgba(22, 18, 13, .42) 28%, rgba(22, 18, 13, 0) 52%);
}
.hero::after {
  background: linear-gradient(rgba(22, 18, 13, 0) 78%, rgba(22, 18, 13, .55) 92%, var(--night));
}
.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(24px, 5.5vh, 72px);
  padding-bottom: 96px;
  text-align: center;
}
.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 12px);
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .75));
}
.wordmark-coin { width: clamp(64px, 7.5vw, 116px); height: auto; }
.wordmark-text { width: clamp(250px, 46vw, 680px); height: auto; overflow: visible; }
.tagline {
  max-width: 36em;
  margin: clamp(2px, .6vw, 8px) 0 clamp(20px, 3vw, 32px);
  font: italic 400 clamp(1.1875rem, .95rem + 1vw, 1.75rem)/1.35 var(--serif);
  color: #f3dca0;
  letter-spacing: .01em;
  text-shadow: 1px 1px 0 #000, 0 0 10px rgba(0, 0, 0, .85);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
}
.hero-notes {
  margin-top: 14px;
  padding: 3px 12px;
  background: rgba(12, 9, 6, .55);
  border-radius: 3px;
  font: 400 .9375rem/1.4 var(--ui);
  color: #f3dca0;
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(0, 0, 0, .9);
}
.hero-notes p { margin: 0; }
.hero-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hero-touch { display: block; color: var(--yellow); }
}
.hero-caption {
  position: absolute;
  right: var(--gutter);
  bottom: 72px;
  margin: 0;
  max-width: 60%;
  font: italic 400 .9375rem/1.3 var(--serif);
  color: #f3dca0;
  text-align: right;
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(0, 0, 0, .9);
}
@media (max-width: 699px) {
  .wordmark { flex-direction: column; gap: 2px; }
  .wordmark-coin { width: 64px; }
  .wordmark-text { width: min(100%, 360px); }
  .hero-content { padding-bottom: 86px; }
  /* on a phone the text sits on the sky and the buttons at the foot, with the harbour between them */
  .hero-actions { margin-top: auto; flex-direction: column; align-items: stretch; width: min(100%, 340px); }
  .hero::before {
    background: linear-gradient(rgba(22, 18, 13, .82), rgba(22, 18, 13, .5) 30%, rgba(22, 18, 13, 0) 48%);
  }
  .hero::after {
    background: linear-gradient(rgba(22, 18, 13, 0) 52%, rgba(22, 18, 13, .7) 76%, var(--night) 99%);
  }
  .hero-caption { display: none; }
  .hero-notes { font-size: .875rem; }
}

/* quick facts: skill-tab style, yellow numbers on stone */
.facts {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: -44px;
  list-style: none;
  overflow: hidden;
}
.facts li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px 12px;
  font: 400 1rem/1.2 var(--ui);
  color: var(--orange);
  text-shadow: 1px 1px 0 #000;
  text-align: center;
}
.facts li + li { box-shadow: inset 1px 0 0 var(--lo), inset 2px 0 0 rgba(255, 255, 255, .07); }
.facts b { font: 700 clamp(1.75rem, 1.4rem + 1vw, 2.25rem)/1.1 var(--ui); color: var(--yellow); }
@media (max-width: 599px) {
  .facts { grid-template-columns: repeat(6, 1fr); }
  .facts li { grid-column: span 2; padding: 10px 4px; font-size: .9375rem; }
  .facts li:nth-child(n + 4) { grid-column: span 3; border-top: 1px solid var(--lo); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
  .facts li:nth-child(5) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 1px 0 0 var(--lo), inset 2px 0 0 rgba(255, 255, 255, .07); }
}

.intro { padding-block: clamp(3rem, 2rem + 4vw, 6rem) 0; }
.lead {
  max-width: 34em;
  margin-inline: auto;
  font-size: clamp(1.25rem, 1.05rem + .9vw, 1.625rem);
  line-height: 1.55;
  text-align: center;
  color: #f0e4c8;
}
@media (max-width: 699px) { .lead { text-align: left; } }

/* ------------------------------------------------------------------ sections */
.section { padding-block: var(--section) 0; }
.section-title {
  margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  font-size: clamp(2.125rem, 1.6rem + 2.4vw, 3.375rem);
  color: var(--orange);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: .005em;
}
.section-sub {
  max-width: 40em;
  margin: calc(-1 * clamp(1rem, .6rem + 1.2vw, 2rem)) 0 clamp(1.75rem, 1.2rem + 2vw, 3rem);
  color: var(--muted);
}

/* features: one wide lead, then pairs */
.features { display: grid; gap: clamp(3rem, 2rem + 3vw, 4.5rem) clamp(1.5rem, 1rem + 2.5vw, 3.5rem); }
.feature h3 {
  margin: 1.1rem 0 .5rem;
  font-size: clamp(1.4375rem, 1.3rem + .5vw, 1.75rem);
  color: var(--orange);
  text-shadow: 1px 1px 0 #000;
}
.feature p { max-width: 36em; }
@media (min-width: 760px) {
  .features { grid-template-columns: 1fr 1fr; }
  .feature-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 7fr 5fr; gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem); align-items: center; }
  .feature-lead h3 { margin-top: 0; font-size: clamp(1.875rem, 1.4rem + 1.2vw, 2.5rem); }
  .feature-lead p { font-size: 1.25rem; }
}

/* screenshots */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, .8rem + 1.5vw, 2rem) clamp(.75rem, .5rem + 1vw, 1.5rem); list-style: none; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery .shot { padding: 4px; }
.gallery figcaption {
  margin-top: .6rem;
  font: italic 400 .9375rem/1.4 var(--serif);
  color: var(--muted);
}
@media (max-width: 499px) { .gallery figcaption { font-size: .875rem; } }

/* how to play */
.start { display: grid; gap: clamp(2rem, 1.5rem + 2vw, 3.5rem); align-items: start; }
@media (min-width: 900px) { .start { grid-template-columns: 1fr 1fr; } }
.sub-title {
  margin-bottom: 1.25rem;
  font-size: clamp(1.5rem, 1.3rem + .7vw, 1.875rem);
  color: var(--orange);
  text-shadow: 1px 1px 0 #000;
}
.steps { list-style: none; counter-reset: step; display: grid; gap: 1.5rem; }
.steps li { position: relative; padding-left: 68px; min-height: 52px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font: 700 1.5rem/1 var(--serif);
  color: var(--gold-ink);
  text-shadow: 0 1px 0 rgba(255, 244, 176, .6);
  background: radial-gradient(circle at 36% 30%, #fff4b0, #f0b830 42%, #b87a10 78%, #8a5a08);
  border: 2px solid #2a1604;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 244, 176, .35), inset 0 -3px 4px rgba(90, 50, 5, .5), 0 3px 8px rgba(0, 0, 0, .6);
}
.steps strong { display: block; margin-bottom: .15rem; font-size: 1.1875rem; }
@media (max-width: 499px) {
  .steps li { padding-left: 56px; }
  .steps li::before { width: 42px; height: 42px; font-size: 1.25rem; }
}
.start figcaption { margin-top: .6rem; font: italic 400 .9375rem/1.4 var(--serif); color: var(--muted); }

.guide { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 2.5rem); margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); align-items: start; }
/* two equal columns on a laptop, so the Controls panel keeps room for its text; the tips get more on wide screens */
@media (min-width: 900px) { .guide { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .guide { grid-template-columns: 5fr 6fr; } }
.box { padding: clamp(20px, 1rem + 1.5vw, 32px); }
/* the label column never takes more than 40% of the panel */
.controls { display: grid; grid-template-columns: minmax(0, min(12.5rem, 40%)) 1fr; gap: 0 1.25rem; }
.controls dt, .controls dd { padding: .8rem 0; border-top: 1px solid rgba(0, 0, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.controls dt:first-of-type, .controls dt:first-of-type + dd { border-top: 0; box-shadow: none; padding-top: 0; }
.controls dt { font: 700 .9375rem/1.6 var(--ui); color: var(--label); text-shadow: 1px 1px 0 #000; }
.controls dd { font-size: 1.0625rem; line-height: 1.55; }
@media (max-width: 519px) {
  .controls { grid-template-columns: 1fr; }
  .controls dd { padding-top: .1rem; border-top: 0; box-shadow: none; }
}
.tips { list-style: none; display: grid; gap: .9rem; }
.tips li { position: relative; padding-left: 1.6rem; }
.tips li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .5em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4b0, #f0b830 50%, #8a5a08);
  box-shadow: 0 0 0 1px #2a1604;
}

.install { margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.install-grid { display: grid; gap: 1.25rem 2rem; margin-top: 1.25rem; list-style: none; }
@media (min-width: 600px) { .install-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .install-grid { grid-template-columns: 1.6fr 1.2fr 1fr 1fr; } }
.install-grid li { padding-top: 1rem; border-top: 1px solid rgba(0, 0, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.install-grid strong { display: block; margin-bottom: .2rem; font: 700 1rem/1.4 var(--ui); text-shadow: 1px 1px 0 #000; }
.install p { max-width: 44em; }

/* ------------------------------------------------------------------ parchment (news, rules, privacy) */
.scroll { max-width: 50rem; margin-inline: auto; padding-inline: 14px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .7)); }
.scroll-roll {
  position: relative;
  z-index: 1;
  height: 22px;
  margin: 0 -10px;
  border-radius: 11px;
  background: linear-gradient(#fbeec6, #d9b878 40%, #a47c42 78%, #6a4a24);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35), 0 2px 3px rgba(0, 0, 0, .35);
}
.scroll-roll::before,
.scroll-roll::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 15px;
  height: 18px;
  border-radius: 5px;
  background: radial-gradient(circle at 40% 35%, #b07a40, #5a3818 70%, #3a220c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.scroll-roll::before { left: -10px; }
.scroll-roll::after { right: -10px; }
.scroll-paper {
  position: relative;
  margin: -6px 0;
  padding: clamp(36px, 2rem + 3vw, 64px) clamp(20px, 1rem + 4vw, 72px) clamp(32px, 2rem + 2vw, 56px);
  color: var(--ink);
  background-color: var(--parch);
  background-image: var(--paper-grain), linear-gradient(90deg, #cfb37a 0%, #ecd9a8 7%, #f6e8c2 30%, #f7eac6 70%, #ecd9a8 93%, #cfb37a 100%);
  box-shadow: inset 0 0 28px rgba(120, 80, 30, .35);
}
.scroll-paper a { color: #8a2a06; }
.scroll-paper a:hover { color: #5a1a02; }
.scroll-paper :focus-visible { outline-color: var(--blue-ink); }
.scroll-paper strong { color: var(--ink); }
.scroll-paper code { color: var(--blue-ink); background: rgba(120, 80, 30, .12); border-color: rgba(106, 76, 30, .3); }
.scroll-title {
  margin-bottom: .35rem;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  color: var(--rubric);
  text-align: center;
  letter-spacing: .01em;
}
.scroll-meta {
  margin: 0 auto 2rem;
  padding-bottom: 1.1rem;
  font: italic 400 1rem/1.4 var(--serif);
  color: var(--ink-soft);
  text-align: center;
  border-bottom: 1px solid rgba(110, 76, 30, .35);
}

/* the news is a quest journal: blue ink, a wax seal per entry */
.journal { list-style: none; position: relative; }
.journal::before { content: ''; position: absolute; left: 7px; top: .6rem; bottom: .6rem; width: 2px; background: rgba(106, 44, 12, .28); }
.journal > li { position: relative; padding-left: 2.25rem; }
.journal > li + li { margin-top: 1.9rem; }
.journal > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .42rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #d0563a, #8e1e10 62%, #5a0e06);
  box-shadow: 0 0 0 2px rgba(241, 226, 184, .9), 0 1px 2px rgba(60, 20, 5, .5);
}
.journal h3 { font-size: clamp(1.3125rem, 1.2rem + .5vw, 1.5rem); color: var(--rubric); }
.journal .when { margin: .15rem 0 .45rem; font-style: italic; font-size: 1rem; color: var(--ink-soft); }
.journal p { color: var(--blue-ink); }
.journal .when { color: var(--ink-soft); }

/* a document on parchment: rules and privacy */
.doc-page { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem) clamp(3rem, 2rem + 4vw, 6rem); }
.doc .scroll-paper { font-size: 1.125rem; line-height: 1.7; }
.doc h2 {
  margin: 2.4rem 0 .75rem;
  font-size: clamp(1.375rem, 1.25rem + .6vw, 1.75rem);
  color: var(--rubric);
}
.doc .intro-text { font-size: clamp(1.125rem, 1rem + .5vw, 1.25rem); line-height: 1.6; }
.doc .scroll-title + .intro-text { margin-top: 1.5rem; }
.doc ul { padding-left: 1.4rem; margin: 0 0 1em; }
.doc li { margin-bottom: .55rem; }
.doc li::marker { color: var(--rubric); }
.doc .back { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(110, 76, 30, .35); text-align: center; font-style: italic; }

/* ------------------------------------------------------------------ FAQ */
.faq-more { max-width: 22em; color: var(--muted); }
.faq-head { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
.faq-head .section-title { margin-bottom: 1rem; }
@media (min-width: 1000px) {
  .faq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.5rem; align-items: start; }
  .faq-head { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
}
.faq-list { display: grid; gap: 10px; max-width: 54rem; }
.faq-item { padding: 0; }
.faq-item summary {
  position: relative;
  display: block;
  padding: 18px 60px 18px 22px;
  font: 700 clamp(1.125rem, 1.05rem + .3vw, 1.3125rem)/1.35 var(--serif);
  color: var(--orange);
  text-shadow: 1px 1px 0 #000;
  list-style: none;
  cursor: pointer;
  border-radius: 2px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  filter: drop-shadow(1px 1px 0 #000);
}
.faq-item summary:hover { color: var(--yellow); }
.faq-item[open] summary { color: var(--yellow); }
.faq-item[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq-item summary:focus-visible { outline-offset: -3px; }
.faq-body {
  margin: 0 22px;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(0, 0, 0, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.faq-body p, .faq-body li { max-width: 40em; }
.faq-body ul { list-style: none; display: grid; gap: .5rem; margin-top: .25rem; }
.faq-body ul li { position: relative; padding-left: 1.4rem; }
.faq-body ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4b0, #f0b830 50%, #8a5a08);
  box-shadow: 0 0 0 1px #2a1604;
}
.contact { font-family: var(--mono); font-size: .92em; color: var(--label); }
.scroll-paper .contact { color: var(--rubric); }

/* ------------------------------------------------------------------ footer: the sea under the coin */
.site-footer {
  position: relative;
  margin-top: var(--section);
  padding: clamp(2.5rem, 2rem + 2vw, 4rem) 0 2.5rem;
  background: linear-gradient(var(--sea), #07182a);
  color: #cfe0ee;
  font-size: 1rem;
}
.site-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -17px;
  height: 18px;
  background: var(--wave) repeat-x 0 0 / 96px 18px;
}
.footer-grid { display: grid; gap: 2rem 3rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 1rem; font: 700 1.5rem/1 var(--serif); color: #f5c542; text-shadow: 1px 1px 0 #000; }
.footer-brand img { width: 52px; height: 52px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 26px; list-style: none; margin-bottom: 1.25rem; }
.footer-links a { display: inline-block; padding: 6px 0; font: 400 1rem/1.3 var(--ui); color: #ffcf6a; text-shadow: 1px 1px 0 #000; }
.footer-links a:hover { color: var(--yellow); }
.site-footer .contact { color: #ffcf6a; }
.fine { font-size: .9375rem; line-height: 1.6; color: #b9cfe0; max-width: 40em; }
.copyright { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(111, 184, 232, .2); font: 400 .875rem/1.4 var(--ui); color: #a9c1d6; }

/* ------------------------------------------------------------------ 404 */
.lost { display: grid; place-items: center; padding-block: clamp(3rem, 2rem + 6vw, 8rem); }
.lost-box { max-width: 36rem; padding: clamp(28px, 1rem + 3vw, 48px); text-align: center; }
.lost-box img { width: 88px; height: 88px; margin: 0 auto 1rem; }
.lost-box h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem); color: var(--orange); text-shadow: 2px 2px 0 #000; margin-bottom: .75rem; }
.lost-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 1.5rem; }

/* ------------------------------------------------------------------ create an account (register.html, register.js)
   The game's own login screen: a stone panel over the docks, dark inset fields, orange labels, yellow status line. */
.reg-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--night);
}
.reg-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}
/* dusk over the harbour so the panels read; the foot fades into the page like the hero */
.reg-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(22, 18, 13, .35), rgba(22, 18, 13, .7)),
    linear-gradient(rgba(22, 18, 13, .45), rgba(22, 18, 13, .2) 45%, rgba(22, 18, 13, .75) 85%, var(--night));
}
.reg-inner {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding-block: clamp(1.5rem, 1rem + 3vw, 4rem) clamp(2.5rem, 2rem + 3vw, 5rem);
}
@media (min-width: 960px) {
  .reg-inner { grid-template-columns: minmax(0, 33rem) minmax(0, 24rem); justify-content: center; align-items: center; }
}
.reg-box { padding: clamp(22px, .75rem + 2.5vw, 40px); }
.reg-coin { width: 64px; height: 64px; margin: 0 auto .5rem; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.reg-title {
  margin-bottom: .6rem;
  font-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.5rem);
  color: var(--orange);
  text-align: center;
  text-shadow: 2px 2px 0 #000;
}
/* focused only to announce a new state; it is not a control */
.reg-title:focus { outline: none; }
.reg-lead { margin-bottom: 1.5rem; text-align: center; font-size: 1.0625rem; line-height: 1.55; }
.reg-note { margin-top: 1rem; padding: 14px 16px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(0, 0, 0, .5); border-left: 3px solid var(--gold); border-radius: 3px; font-size: 1.0625rem; }
.reg-note p + p { margin-top: .75em; }
.reg-small { margin-top: 1.1rem; font: 400 .9375rem/1.55 var(--ui); color: var(--muted); text-shadow: 1px 1px 0 #000; }
.reg-small .contact { font-size: .95em; }

/* fields */
.field { margin-bottom: 1.15rem; }
.field-label { display: block; margin-bottom: .35rem; font: 700 .9375rem/1.3 var(--ui); color: var(--label); text-shadow: 1px 1px 0 #000; }
.field-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: 400 1.0625rem/1.3 var(--ui);
  color: #fff;
  background: #16120d;
  border: 1px solid #0a0806;
  border-radius: 3px;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06);
}
.field-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--orange); }
.field-input[aria-invalid="true"] { border-color: #ff6a55; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 106, 85, .45); }
.field-input:read-only { color: var(--muted); }
.field-hint { margin: .4rem 0 0; font: 400 .875rem/1.45 var(--ui); color: var(--muted); }
.field-error {
  position: relative;
  margin: .45rem 0 0;
  padding-left: 1.15rem;
  font: 700 .9375rem/1.4 var(--ui);
  color: #ff8a7a;
  text-shadow: 1px 1px 0 #000;
}
.field-error::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .42em;
  width: 8px;
  height: 8px;
  background: #ff6a55;
  box-shadow: 0 0 0 1px #2a0802;
  transform: rotate(45deg);
}
.field-check { display: grid; grid-template-columns: auto 1fr; gap: 0 .75rem; align-items: start; margin-top: 1.4rem; }
.field-check label { font: 400 1rem/1.5 var(--ui); color: var(--text); cursor: pointer; }
.field-check .field-error { grid-column: 1 / -1; }
.check { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--gold); cursor: pointer; }

/* one message for the whole form (a rate limit, no connection): only takes room when it has text */
.form-error:not(:empty) {
  margin-bottom: 1rem;
  padding: 10px 14px;
  font: 700 .9375rem/1.45 var(--ui);
  color: #ffd6cc;
  background: rgba(122, 22, 10, .45);
  border: 1px solid rgba(255, 106, 85, .55);
  border-radius: 3px;
  text-shadow: 1px 1px 0 #000;
}

/* "Checking you are not a bot...": a spinning coin and the chance that the puzzle is solved by now */
.reg-status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(0, 0, 0, .55);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.reg-status-coin { flex: none; width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.reg-status-body { flex: 1; min-width: 0; }
.reg-status-text { margin: 0 0 7px; font: 700 .9375rem/1.3 var(--ui); color: var(--yellow); text-shadow: 1px 1px 0 #000; }
.reg-bar {
  height: 10px;
  overflow: hidden;
  background: #16120d;
  border: 1px solid #0a0806;
  border-radius: 5px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .7);
}
.reg-bar-fill {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(#fff4b0, #ffd84a 40%, #d99a18);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.reg-submit { width: 100%; margin-top: .25rem; }
.reg-submit:disabled { cursor: progress; filter: saturate(.6) brightness(.85); }

/* account created / registration opens soon */
.reg-state { text-align: center; }
.reg-state .reg-lead { font-size: 1.1875rem; }
.reg-name { color: var(--yellow); font-family: var(--ui); text-shadow: 1px 1px 0 #000; }
.reg-play { width: min(100%, 20rem); }

/* how it works, beside the panel on a wide screen and under it on a phone */
.reg-side {
  padding: clamp(20px, 1rem + 1.5vw, 32px);
  background: rgba(20, 16, 11, .82);
  border: 1px solid rgba(0, 0, 0, .6);
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .06), 0 6px 22px rgba(0, 0, 0, .5);
}
.reg-side .sub-title { margin-bottom: 1.1rem; }
.reg-steps { gap: 1.1rem; }
.reg-steps li { font-size: 1.0625rem; line-height: 1.55; }
.reg-steps strong { font-size: 1.0625rem; }
.reg-side .reg-small:first-of-type { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid rgba(0, 0, 0, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
@media (max-width: 499px) {
  .reg-steps li { padding-left: 56px; }
}

@media (prefers-reduced-motion: no-preference) {
  .reg-status-coin { animation: reg-coin 1.5s linear infinite; }
  .reg-bar-fill { transition: transform .2s ease-out; }
  .reg-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, 0) 70%);
    transform: translateX(-100%);
    animation: reg-shine 1.6s ease-in-out infinite;
  }
  .field-input { transition: border-color .12s, box-shadow .12s; }
}
@keyframes reg-coin { to { transform: rotateY(360deg); } }
@keyframes reg-shine { to { transform: translateX(100%); } }

/* ------------------------------------------------------------------ lightbox (site.js builds it) */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: #0c0906;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(10, 8, 5, .97); }
.lb-stage {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 12px clamp(12px, 2vw, 24px) 16px;
}
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.lb-count { margin: 0; font: 400 .9375rem/1 var(--ui); color: var(--muted); text-shadow: 1px 1px 0 #000; }
.lb-figure {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px clamp(0px, 5vw, 72px) 0;
}
.lb-figure .shot { padding: 5px; cursor: default; max-width: 100%; }
.lb-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 170px);
  object-fit: contain;
}
.lb-cap {
  max-width: 48em;
  margin-top: .8rem;
  font: italic 400 1.0625rem/1.4 var(--serif);
  color: #f3dca0;
  text-align: center;
}
.lb-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 64px;
  padding: 0;
  transform: translateY(-50%);
}
.lb-nav::before {
  content: '';
  width: 14px;
  height: 14px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  filter: drop-shadow(1px 1px 0 #000);
}
.lb-prev { left: clamp(8px, 1.5vw, 20px); }
.lb-prev::before { transform: translateX(3px) rotate(45deg); }
.lb-next { right: clamp(8px, 1.5vw, 20px); }
.lb-next::before { transform: translateX(-3px) rotate(-135deg); }
@media (max-width: 699px) {
  .lb-figure { padding-inline: 0; }
  .lb-img { max-height: calc(100dvh - 230px); }
  .lb-nav { top: auto; bottom: 16px; transform: none; height: 52px; }
  .lb-stage { padding-bottom: 80px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in .18s ease-out; }
  .lightbox[open]::backdrop { animation: lb-in .18s ease-out; }
  .btn, .shot, .shot img, .site-nav a, .faq-item summary { transition: color .12s, background-color .12s, filter .12s; }
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ print */
@media print {
  .site-header, .hero-actions, .nav-toggle, .site-footer::before { display: none; }
  body { background: #fff; color: #000; }
}
