@font-face { font-family: "Tenor Sans"; src: url(/fonts/tenor-lat.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tenor Sans"; src: url(/fonts/tenor-cyr.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-400-lat.woff2) format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-400-cyr.woff2) format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-700-lat.woff2) format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-700-cyr.woff2) format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-400i-lat.woff2) format("woff2"); font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; src: url(/fonts/ptsans-400i-cyr.woff2) format("woff2"); font-style: italic; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Mono"; src: url(/fonts/ptmono-lat.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Mono"; src: url(/fonts/ptmono-cyr.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  /* box tray cardboard, box print, manual sheet, key card stock */
  --cardboard: #d3cdc1;
  --cardboard-deep: #bdb6a8;
  --print: #17140f;
  --print-2: #4a443b;
  --print-3: #6b655a;
  --sheet: #f7f6f2;
  --card: #ffffff;
  --rule: rgba(23, 20, 15, .16);
  --rule-strong: rgba(23, 20, 15, .38);
  /* one red: actions and the activation stamp */
  --stamp: #b3261e;
  --stamp-deep: #8f1d17;
  --up: #2f6b2a;
  --on-print: #ece9e1;
  --on-print-2: #aaa49a;

  --display: "Tenor Sans", "Optima", "Candara", sans-serif;
  --text: "PT Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "PT Mono", "Consolas", "Menlo", monospace;

  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .08 0 0 0 0 .06 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #8a8378 var(--cardboard); }
body {
  margin: 0;
  font: 400 17px/1.55 var(--text);
  color: var(--print);
  background-color: var(--cardboard);
  background-image: var(--fibre); /* unprinted cardboard fibre */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  caret-color: var(--stamp);
}
/* the fold-out map of Darrowshire's surroundings under the whole page: a fixed layer multiplied onto
   the cardboard, so it shows from header to footer while the page scrolls over it (white = no ink) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url(/assets/map.webp) center / cover no-repeat;
  mix-blend-mode: multiply;
}
::selection { background: var(--print); color: var(--on-print); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--stamp-deep); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; border-radius: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- box band (header) */

.band { background: var(--print); color: var(--on-print); }
.band__in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.mark { display: flex; flex-direction: column; text-decoration: none; line-height: 1.05; }
.mark:hover { color: inherit; }
.mark__name { font-family: var(--display); font-size: 22px; letter-spacing: .2em; }
.mark__sub { font-size: 12.5px; color: var(--on-print-2); letter-spacing: .04em; margin-top: 4px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--on-print-2); font-size: 15.5px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--on-print); }
.nav a[aria-current="page"] { color: var(--on-print); border-bottom-color: var(--on-print); }
.live { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--on-print); white-space: nowrap; padding-left: 22px; border-left: 1px solid rgba(236, 233, 225, .16); }
.live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--on-print-2); flex: none; }
.live[data-state="up"] .live__dot { background: #63b55a; }
.live[data-state="down"] .live__dot { background: #e0574d; }
.live__players { color: var(--on-print-2); }

@media (max-width: 760px) {
  .band__in { flex-wrap: wrap; gap: 0 16px; padding-block: 12px 0; }
  .live { margin-left: auto; padding-left: 0; border-left: 0; font-size: 13.5px; }
  .live__players { display: none; }
  .mark__name { font-size: 18px; letter-spacing: .16em; }
  .nav { order: 3; width: 100%; margin: 8px 0 0; gap: 20px; overflow-x: auto; }
}

/* ---------------------------------------------------------------- page scaffolding */

main { flex: 1; padding-block: clamp(28px, 5vw, 56px) 72px; }
.section { margin-top: clamp(56px, 8vw, 96px); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; }
h2 { font-size: clamp(26px, 3vw, 32px); line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.25; }
p { margin: 0 0 1em; }
.lead { font-size: 18.5px; color: var(--print-2); max-width: 62ch; }
.muted { color: var(--print-2); }

/* manual sheet */
.sheet {
  background: var(--sheet);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(23, 20, 15, .14), 0 10px 30px -18px rgba(23, 20, 15, .45);
  padding: clamp(22px, 3.2vw, 40px);
}

/* table-of-contents rows: label ..... value */
.toc { list-style: none; margin: 0; padding: 0; }
/* a value too long for the row drops whole onto the next line, right-aligned; the dots keep the first line */
.toc li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; padding: 7px 0; }
.toc__k { flex: none; max-width: 100%; }
.toc__lead { flex: 1; min-width: 24px; margin: 0 .55em; border-bottom: 2px dotted var(--rule-strong); transform: translateY(-.32em); }
.toc__v { flex: none; max-width: 100%; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums lining-nums; font-weight: 700; }
.toc__v small { font-weight: 400; color: var(--print-2); font-size: 14.5px; }
.toc--quiet .toc__v { font-weight: 400; }

/* buttons and inputs */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 16px/1 var(--text); letter-spacing: .02em; text-decoration: none;
  min-height: 48px; padding: 0 24px; border-radius: 4px;
  background: var(--stamp); color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background-color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--stamp-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #cfc9be; color: #4a443b; cursor: not-allowed; box-shadow: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--quiet { background: transparent; color: var(--print); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.btn--quiet:hover { background: rgba(23, 20, 15, .06); color: var(--print); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14.5px; }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--print); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; cursor: pointer; }
.linkbtn:hover { color: var(--stamp-deep); }

.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field__hint { display: block; font-size: 14px; color: var(--print-2); margin-top: 6px; }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 400 17px/1.3 var(--text); color: var(--print);
  background: #fff; border: 1px solid var(--rule-strong); border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--print-3); }
.input:hover { border-color: var(--print-2); }
.input:focus { outline: none; border-color: var(--print); box-shadow: inset 0 0 0 1px var(--print); }
.input[aria-invalid="true"] { border-color: var(--stamp); }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.5; }

.note { font-size: 15px; padding: 12px 14px; border-radius: 4px; margin: 0 0 16px; }
.note--error { background: #f6e3e1; color: #7d1a14; }
.note--ok { background: #e3eedf; color: #1f4a1b; }

.copy { display: inline-flex; align-items: center; gap: 6px; appearance: none; border: 0; background: none; cursor: pointer; font: 400 14px/1 var(--text); color: var(--print-2); padding: 6px 8px; border-radius: 4px; }
.copy:hover { background: rgba(23, 20, 15, .07); color: var(--print); }
.copy svg { width: 16px; height: 16px; }
.copy[data-done] { color: var(--up); }

.icon { width: 18px; height: 18px; flex: none; }

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

.foot { border-top: 1px solid var(--rule); padding-block: 22px 28px; font-size: 14px; color: var(--print-2); }
.foot__in { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- account */

.narrow > * { max-width: 720px; }
.narrow > .sheet + .sheet, .narrow [data-account] > .sheet + .sheet { margin-top: 24px; }
.acc-name { font-family: var(--mono); font-size: clamp(28px, 4vw, 38px); letter-spacing: .08em; margin-bottom: 14px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.small-gap { margin-top: 18px; margin-bottom: 0; font-size: 15px; }
.sheet h2 + .muted { margin-top: 8px; }
.sheet h1 + .lead { margin-top: 10px; }
.sheet form { margin-top: 18px; }

/* ---------------------------------------------------------------- admin */

.narrow-block { max-width: 640px; }
.admin { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto 1fr auto; gap: 28px; align-items: start; }
.admin__issue { grid-column: 1; grid-row: 1 / 4; }
.admin__issue h1 { margin-bottom: 8px; }
.admin__keys { grid-column: 2; grid-row: 1; }
.admin__accounts { grid-column: 2; grid-row: 2; }
.admin__news { grid-column: 1 / -1; grid-row: 4; }
.issue { margin-top: 18px; }
.issued { margin-top: 26px; }
.issued--fresh .issued__card { animation: thump-in .5s var(--ease) both; }
@keyframes thump-in { from { opacity: 0; transform: translateY(-10px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.issued__card { margin-bottom: 18px; max-width: 460px; }
.message { white-space: pre-wrap; background: var(--sheet); border-radius: 4px; padding: 12px 14px; font-size: 15px; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--rule); overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin: 0 calc(-1 * clamp(22px, 3.2vw, 40px)); padding: 0 clamp(22px, 3.2vw, 40px); }
.table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.table th { text-align: left; font-weight: 700; font-size: 13.5px; color: var(--print-2); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.table tr:last-child td { border-bottom: 0; }
.table__act { text-align: right; white-space: nowrap; font-size: 14.5px; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; font-size: 13.5px; padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.tag--free { background: #e3eedf; color: #1f4a1b; }
.tag--used { background: rgba(23, 20, 15, .08); color: var(--print); }
.tag--revoked { background: #f6e3e1; color: #7d1a14; text-decoration: line-through; }
.danger, .linkbtn.danger { color: var(--stamp); }
.newslist { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.newslist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.newslist__title { flex: 1; min-width: 12ch; }
.empty { color: var(--print-2); font-style: italic; }

@media (max-width: 1000px) {
  .admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .admin__issue, .admin__keys, .admin__accounts, .admin__news { grid-column: auto; grid-row: auto; }
}
