/* The administrator's panel of the shop. Same language as the website (site/css/site.css): parchment ground, the
   game's windows and buttons from the site's own nine-slices, its pixel font for names and numbers, Alegreya Sans for
   everything read. The fonts and frames are the website's files, asked from its address; without them the panel is
   plain but whole. No script anywhere. */

@font-face { font-family: "CastleSMP Pixel"; src: url("/fonts/CastleSMPPixel.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; src: url("/fonts/AlegreyaSans-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; src: url("/fonts/AlegreyaSans-Bold.woff2") format("woff2"); font-display: swap; }

:root {
  --parchment: #f1e4cc;
  --sheet: #f6ecd6;
  --ink: #2a211a;
  --ink-soft: #594839;
  --band: #3b3632;
  --band-deep: #292521;
  --pale: #f3e9d4;
  --pale-soft: #cdc1ab;
  --zl: #2c7a33;
  --copper: #a8562a;
  --gold: #ffcf4a;
  --bad: #9c2b1c;
  --px: 3px;
  --pixel: "CastleSMP Pixel", "Alegreya Sans", sans-serif;
  --text: "Alegreya Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
@media (max-width: 599px) { :root { --px: 2px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--parchment);
  color: var(--ink);
  font: 400 17px/1.45 var(--text);
  font-variant-numeric: lining-nums tabular-nums;
}
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--copper); }
:focus-visible { outline: var(--px) solid var(--ink); outline-offset: 2px; }
.top :focus-visible { outline-color: var(--gold); }
code { font: 0.86em ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 0.1em 0.35em; background: rgb(42 33 26 / 0.09); overflow-wrap: anywhere; }
small { font-size: 0.86em; color: var(--ink-soft); }
h1, h2, .brand, .btn, .tiles b, th, .tabs a, .top nav a {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
  font-variant-numeric: normal;
}
h1 { font-size: 30px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
h1 small { display: inline-flex; gap: 6px; font-family: var(--text); text-transform: none; }
h2 { font-size: 20px; margin-bottom: 10px; }

/* the top: a dark band, as the website's */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: var(--band);
  color: var(--pale);
  border-bottom: calc(2 * var(--px)) solid var(--band-deep);
}
.brand { font-size: 20px; color: var(--gold); text-decoration: none; text-shadow: 0.1em 0.1em 0 rgb(0 0 0 / 0.5); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.top nav a { padding: 8px 12px; font-size: 20px; text-decoration: none; color: var(--pale); }
.top nav a:hover, .top nav a[aria-current] { background: var(--band-deep); color: var(--gold); box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--gold); }
.out { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--pale-soft); }

main { width: min(1240px, 100%); margin: 0 auto; padding: 22px clamp(12px, 3vw, 28px) 60px; }
.lead, .state, .empty, .back { margin: 0 0 14px; color: var(--ink-soft); }
.back a::before { content: "‹ "; }
.note, .bad { margin: 0 0 16px; padding: 8px 12px; border-left: calc(2 * var(--px)) solid var(--zl); background: var(--sheet); font-weight: 700; }
.bad { border-left-color: var(--bad); color: var(--bad); }

/* the game's window and button */
.win {
  margin: 0 0 18px;
  padding: 8px 10px 12px;
  border: calc(4 * var(--px)) solid transparent;
  border-image: url("/assets/ui/window.png") 4 fill / calc(4 * var(--px)) / 0 stretch;
  image-rendering: pixelated;
  background: var(--sheet) padding-box;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: calc(14 * var(--px));
  padding: 0 calc(5 * var(--px)) calc(1 * var(--px));
  border: calc(3 * var(--px)) solid transparent;
  border-image: url("/assets/ui/btn-dark.png") 3 fill / calc(3 * var(--px)) / 0 stretch;
  image-rendering: pixelated;
  background: #544c45 padding-box;
  color: #fff;
  font-size: 20px;
  text-shadow: 0.1em 0.1em 0 rgb(0 0 0 / 0.45);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(var(--px)); }
.btn.go { border-image-source: url("/assets/ui/btn-green.png"); background-color: #34803a; }
.btn.warn { border-image-source: url("/assets/ui/btn-copper.png"); background-color: var(--copper); }

/* forms */
label { display: grid; gap: 4px; font-weight: 700; color: var(--ink-soft); font-size: 15px; }
input:not([type="hidden"]), textarea {
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border: var(--px) solid var(--ink);
  border-radius: 0;
  background: #fffaf0;
  color: var(--ink);
  font: 400 17px/1.3 var(--text);
}
textarea { resize: vertical; }
.login { width: min(420px, 100%); margin: 8vh auto 0; }
.login form, .stack { display: grid; gap: 12px; }
.find { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 16px; }
.find label { flex: 1 1 260px; }
.acts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.act { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.act.wide { flex: 1 1 100%; }
.act.wide label { flex: 1 1 320px; }

/* the day at a glance */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.tiles li { display: grid; gap: 2px; padding: 10px 12px; background: var(--band); color: var(--pale); }
.tiles span { color: var(--pale-soft); font-size: 15px; }
.tiles b { font-size: 30px; color: var(--gold); text-shadow: 0.1em 0.1em 0 rgb(0 0 0 / 0.5); }
.tiles small { color: var(--pale-soft); }
.tiles li.alert { box-shadow: inset 0 0 0 var(--px) #ff8f80; }
.tiles li.alert b { color: #ff8f80; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; }
.tabs a { padding: 8px 12px; background: var(--sheet); font-size: 20px; text-decoration: none; }
.tabs a:hover { color: var(--ink); background: #e9d9b8; }
.tabs a[aria-current] { background: var(--band); color: var(--gold); }

/* tables */
.scroll { overflow-x: auto; margin: 0 0 16px; background: var(--sheet); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; }
th { font-size: 20px; background: var(--band); color: var(--pale); white-space: nowrap; }
tbody tr { border-top: 1px solid rgb(42 33 26 / 0.18); }
tbody tr:hover { background: #efe0c2; }
.num { text-align: right; white-space: nowrap; }
td:first-child a { font-weight: 700; white-space: nowrap; }
.pages { display: flex; align-items: center; justify-content: center; gap: 18px; }

.badge { display: inline-block; padding: 1px 8px; font-size: 14px; font-weight: 700; white-space: nowrap; color: #fff; background: var(--ink-soft); }
.badge.ok { background: var(--zl); }
.badge.wait { background: #8a6a12; }
.badge.bad { background: var(--bad); }
.badge.off { background: #6e655c; }

/* one order */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 18px; }
dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; margin: 0; }
dt { color: var(--ink-soft); }
dd { margin: 0; overflow-wrap: anywhere; }
.events { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.events li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.events time { color: var(--ink-soft); white-space: nowrap; }

@media (max-width: 599px) {
  body { font-size: 16px; }
  h1 { font-size: 20px; }
  .top nav a, .tabs a, th, .btn { font-size: 20px; }
  dl { grid-template-columns: 1fr; gap: 0; }
  dd { margin-bottom: 8px; }
  .events li { grid-template-columns: 1fr; gap: 0; }
}

/* the key of the second factor, shown once while an account is being set up: large, selectable in one touch */
.key { margin: 0 0 16px; }
.key code { display: block; padding: 10px 12px; font-size: 1.25rem; letter-spacing: 0.06em; word-spacing: 0.3em; overflow-wrap: anywhere; user-select: all; }
.login form + .lead { margin: 16px 0 0; }
