/*
 * Lemonade portal: an early-2000s Frutiger Aero page. A solid Cloud
 * blue, white Finder-style windows with glossy blue title bars, green gel
 * buttons, 12px Lucida Grande (Verdana, then DejaVu Sans, where it's missing).
 *
 * Pixel art is the one thing kept crisp: icons are drawn at their own 16x16 and
 * the logo (112x32) at 3x (336x96), always whole multiples, never scaled between.
 * Files in static/img named icon-<name>.png or art-<slot>.png are picked up
 * at startup and fill the matching `.icon-<name>` or `.art-<slot>` (the server
 * adds the CSS for them; see artRules in core.ts). They're cut from the site
 * sprite sheet (art/site-spritesheet.png) by scripts/slice-sprites.mjs.
 *
 * Colours come from the tokens in :root: --ink (text), --link, --muted, --line
 * (every rule), --paper (fields and windows), --page (the page itself).
 *
 * Sections: tokens · base · masthead · page grids · boxes · forms · content
 * bits · inbox & messages · admin panel · guilds · moderation · icons · art
 * slots · footer · small screens.
 */

:root {
  --dot-off: #808080;
  --dot-on: #5fbf3c;
  color-scheme: light;
  --page: #e6f4fc;
  --paper: #fff;
  --ink: #1b3550;
  --link: #0b62bd;
  --link-dim: #4d7aa6;
  --muted: #5a7590;
  --bad: #c03a2b;
  --line: #a7c7e4;
  --font: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, "DejaVu Sans", sans-serif;
}

/* --- Base ------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  font: 12px/16px var(--font);
  color: var(--ink);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  color: #e07a00;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

p {
  margin: 0 0 8px;
}

img {
  image-rendering: pixelated;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  padding: 0 6px;
  color: var(--paper);
  background: var(--ink);
}

.muted {
  color: var(--muted);
}

strong {
  color: var(--ink);
}

/* Stylized text: headings, buttons. */

.page-title,
.widget-bar h2,
button,
.button,
.featured-title,
.article-title {
  font-family: var(--font);
}

/* Visible to screen readers only. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Masthead ------------------------------------------------------------------------ */

/* Logo, then one row of links with their icons, then the world's status, all centered. */

.masthead {
  text-align: center;
  padding: 8px 8px 0;
  margin-bottom: 12px;
  background: linear-gradient(#fbfeff 0, #dff0fc 45%, #cfe6f8 50%, #dcedfb 100%);
  border-bottom: 1px solid #8fb9de;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgb(0 70 140 / 0.2);
}

.brand {
  display: block;
  width: 336px;
  margin: 0 auto 6px;
  margin-bottom: 4px;
}

.brand .art {
  margin: 0 auto;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0;
}

.tool {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 4px;
  height: 26px;
  padding: 0 12px;
  color: #1b3550;
  background: linear-gradient(#fff 0, #eaf5fe 48%, #d6eafb 52%, #e9f5ff 100%);
  border: 1px solid #8fb9de;
  border-left-width: 0;
  box-shadow: inset 0 1px 0 #fff;
}

.tool.is-active {
  color: #fff;
  text-shadow: 0 1px 1px rgb(0 40 90 / 0.6);
  background: linear-gradient(#7fcaff 0, #2f95e8 48%, #0f74cc 52%, #45aaf0 100%);
  border-color: #0b5aa6;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6);
}

.tool .icon {
  width: 16px;
  height: 16px;
}

.status {
  margin: 2px 0 8px;
  font-size: 11px;
  color: #3f6a93;
  text-shadow: 0 1px 0 #fff;
}

/* The page's own title, centered under the header. */

.page-title {
  text-align: center;
  line-height: 24px;
  font-size: 16px;
  margin: 12px 0 8px;
}

/* --- Page grids --------------------------------------------------------------------- */

.page {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 8px 20px;
}

.page-narrow {
  max-width: 456px;
}

/* A column of boxes. */

.stack,
.zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.grid-front {
  display: grid;
  grid-template-areas: "left mid right";
  gap: 12px;
  align-items: start;
  grid-template-columns: 200px minmax(0, 1fr) 220px;
}

.area-left {
  grid-area: left;
}

.area-right {
  grid-area: right;
}

.area-mid {
  grid-area: mid;
}

.grid-profile {
  display: grid;
  grid-template-areas: "card record friends";
  gap: 12px;
  align-items: start;
  grid-template-columns: 200px minmax(0, 1fr) 360px;
}

.area-card {
  grid-area: card;
}

.area-record {
  grid-area: record;
}

.area-friends {
  grid-area: friends;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

/* Main column plus a sidebar (right by default). */

.grid-side {
  display: grid;
  gap: 12px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.grid-side-left {
  grid-template-columns: 200px minmax(0, 1fr);
}

/* --- Boxes ------------------------------------------------------------------------------ */

.widget {
  min-width: 0;
  text-align: left;
  background: #fff;
  border: 1px solid #8fb9de;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 70 140 / 0.25);
  overflow: hidden;
}

.widget-bar {
  position: relative;
  padding: 4px 8px;
  text-align: center;
  border-bottom: 1px solid #8fb9de;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
  background: linear-gradient(#8dd4ff 0, #49aff2 48%, #1b8ae0 52%, #46b3f3 100%);
  border-bottom-color: #1a78c8;
}

.widget-bar h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 50 110 / 0.7);
}

.widget-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  justify-content: flex-start;
  gap: 0 12px;
  padding: 3px 8px;
  background: linear-gradient(#f4fbff, #e1f1fd);
  border-bottom-color: #a7c7e4;
}

.widget-tabs a.is-active {
  color: var(--ink);
}

.widget-body {
  padding: 8px;
}

.widget-body.flush {
  padding: 0;
}

.widget-body > :last-child {
  margin-bottom: 0;
}

.widget-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding: 3px 8px;
  background: linear-gradient(#f2faff, #d3e9f9);
  border-top-color: #b8d6ee;
}

.strip {
  margin: 0 0 6px;
  color: var(--muted);
}

/* --- Forms ---------------------------------------------------------------------------- */

form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 8px;
}

form:last-child {
  margin-bottom: 0;
}

label {
  color: var(--muted);
  font-size: 11px;
}

label.check {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--ink);
  text-align: left;
}

input,
textarea,
select {
  font: inherit;
  padding: 0 6px;
  height: 28px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

textarea {
  padding: 3px 6px;
  text-align: left;
  resize: vertical;
  height: auto;
  min-height: 60px;
}

input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  accent-color: var(--link);
}

input[type="file"] {
  height: auto;
  padding: 3px 6px;
}

button,
.button,
input[type="file"]::file-selector-button {
  display: inline-block;
  cursor: pointer;
  text-align: center;
  padding: 2px 10px;
  font: bold 11px/16px var(--font);
  color: #17400a;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.55);
  background: linear-gradient(#e6ffc2 0, #a8e86a 48%, #7fd43b 52%, #b6ee80 100%);
  border: 1px solid #4a9a1c;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 1px 2px rgb(0 60 0 / 0.35);
}

.button:hover,
button:hover,
input[type="file"]::file-selector-button:hover {
  color: var(--paper);
  text-decoration: none;
  background: var(--ink);
}

button.secondary,
.button.secondary {
  color: #29506f;
  background: linear-gradient(#fff 0, #dcefff 48%, #bcdcf6 52%, #e4f3ff 100%);
  border-color: #7fa8cc;
}

button.secondary:hover,
.button.secondary:hover {
  color: #29506f;
  background: linear-gradient(#fff 0, #eaf6ff 48%, #cfe7fa 52%, #f2faff 100%);
}

button.small,
.button.small {
  padding: 0 6px;
  line-height: 16px;
}

.button-big {
  display: block;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 20px;
}

.button-wide {
  display: block;
}

/* Playing is the one thing the site is for. */

.button-big:not(.secondary) {
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 70 0 / 0.65);
  background: linear-gradient(#a6ef6a 0, #52c41a 48%, #3aa80d 52%, #6fda37 100%);
  border-color: #2f7d0c;
  border-radius: 16px;
}

.button-big:not(.secondary):hover {
  color: #fff;
  background: linear-gradient(#bdf68a 0, #6bd62f 48%, #4dbb1a 52%, #86e650 100%);
}

.play-now {
  margin-top: 12px;
}

.hint {
  margin: 0 0 6px;
  color: var(--muted);
}

.inline-form {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 90px;
}

/* One field, full width, with its button centered beneath (player search, add a friend). */

form.stack-form {
  align-items: stretch;
}

.stack-form input {
  align-self: stretch;
}

/* On your own profile card, under your stats. */

.profile-settings {
  margin: 12px 0 0;
  text-align: center;
}

.flash {
  border: 1px solid;
  margin: 0 0 8px;
  padding: 4px 8px;
  text-align: left;
  border-radius: 4px;
  border-color: var(--line);
}

.flash.notice {
  color: #1c5e12;
  background: #e5f9d4;
}

.flash.error {
  color: #8c2418;
  background: #fde3df;
}

/* --- Content bits ------------------------------------------------------------------------ */

.links {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.media {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
}

.widget-body:not(.flush) > .empty {
  padding: 0;
}

.count {
  color: var(--muted);
}

.tag {
  padding: 0 7px;
  color: #fff;
  background: linear-gradient(#6cc3ff, #1f8be0);
  border-radius: 8px;
}

.featured-meta {
  color: var(--muted);
  margin: 0 0 4px;
}

.featured-title,
.article-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 22px;
}

.headlines {
  margin: 12px -12px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.headlines li {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.headlines li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.headlines li > div {
  min-width: 0;
}

.headline-date {
  display: block;
  color: var(--muted);
}

.news-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.news-card:first-child {
  padding-top: 0;
}

.news-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.news-card h3 {
  margin: 0 0 4px;
  font: bold 14px/20px var(--font);
}

.news-card > div {
  min-width: 0;
}

.article .art-hero {
  margin-bottom: 12px;
}

/* A post's own words: left-aligned, as long text reads better. */

.prose {
  text-align: left;
}

.prose h4,
.prose h5,
.prose h6 {
  margin: 16px 0 6px;
  font: bold 14px/20px var(--font);
  color: var(--link);
}

.prose ul,
.prose ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.prose blockquote {
  margin: 0 0 12px;
  padding: 0 12px;
  border-left: 1px solid var(--muted);
  color: var(--muted);
}

.prose code,
.prose pre {
  font: inherit;
  color: var(--link);
}

.prose pre {
  padding: 6px 12px;
  overflow-x: auto;
  border: 1px solid var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.news-img {
  display: block;
  max-width: 100%;
  margin: 0 0 12px;
}

/* Category and month lists, highscore menus, kill lists, friends. */

.index li {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 3px 8px;
}

.index a.is-active,
.menu a.is-active {
  color: var(--ink);
}

/* Small labels between a list's groups. */

.menu-label {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3a6590;
  background: linear-gradient(#f4fbff, #d9eefc);
}

.menu-label:first-child {
  border-top: 0;
}

.index:last-child li:last-child,
.menu:last-child li:last-child a {
  border-bottom: 0;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  min-height: 0;
  padding: 3px 8px;
}

/* Tables: every cell boxed, everything centered. */

.scores {
  width: 100%;
  border-collapse: collapse;
}

.scores th,
.scores td {
  border: 1px solid var(--line);
  padding: 2px 6px;
  text-align: center;
}

.scores td .icon {
  vertical-align: middle;
  margin-right: 6px;
}

/* A table in a box with no padding shares the box's border. */

.widget-body.flush .scores th:first-child,
.widget-body.flush .scores td:first-child {
  border-left: 0;
}

.widget-body.flush .scores th:last-child,
.widget-body.flush .scores td:last-child {
  border-right: 0;
}

.widget-body.flush .scores tr:first-child > th,
.widget-body.flush .scores tr:first-child > td {
  border-top: 0;
}

.widget-body.flush .scores tr:last-child > td {
  border-bottom: 0;
}

/* Above a table: the search at the left, the pages at the right. */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

form.search-form {
  flex-direction: row;
  margin: 0;
}

.search-form input {
  max-width: 100%;
  width: 180px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pager span {
  color: var(--muted);
}

/* Name and value, side by side, in boxes of their own. */

.stat-list {
  margin: 0;
  border: 1px solid var(--line);
  text-align: center;
}

.stat-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.stat-list div:first-child {
  border-top: 0;
}

.stat-list dt,
.stat-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  padding: 2px 6px;
  text-align: center;
}

.stat-list dd {
  border-left: 1px solid var(--line);
  text-align: center;
}

.widget-body.flush > .stat-list {
  border: 0;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--dot-off);
  border-radius: 50%;
}

.dot.up {
  background: var(--dot-on);
}

.friends li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  justify-content: flex-start;
  padding: 4px 8px;
}

.friends form {
  margin: 0;
}

.friend-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.friend-name .hint {
  margin: 0;
}

/* A meter: gold on black, in a white frame. */

.bar {
  appearance: none;
  display: block;
  width: 100%;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.bar::-webkit-progress-bar {
  background: #fff;
}

.bar::-webkit-progress-value {
  background: linear-gradient(#d7ff9e, #66c92a 50%, #4aad15 51%, #8ae04d);
}

.bar::-moz-progress-bar {
  background: var(--link);
}

/*
 * The XP bar on a profile, as the game draws it, at 2x: the star (with the
 * level on it in the game's digits) over the left end of the bar, its fill
 * coming out from under the star. The pieces are cut from the game's UI
 * sheet (xp-*.png); the bar and fill stretch between their end caps.
 */

.xp-meter {
  position: relative;
  width: 160px;
  height: 32px;
  margin: 0 auto;
}

.xp-star {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: url("/static/img/xp-star.png?v=3VON0WmlLq70") 0 0 / 32px 32px no-repeat;
  image-rendering: pixelated;
}

.xp-digit {
  flex: none;
  width: 18px;
  height: 18px;
  background: 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
}

/* Digits overlap by a pixel, as the game sets them. */

.xp-digit + .xp-digit {
  margin-left: -2px;
}

.xp-digit-0 {
  background-image: url("/static/img/xp-digit-0.png?v=pqDs-4ybeXSm");
}

.xp-digit-1 {
  background-image: url("/static/img/xp-digit-1.png?v=QTdFTR5zI0Vn");
  width: 14px;
}

.xp-digit-2 {
  background-image: url("/static/img/xp-digit-2.png?v=7Wlv1jvu2azz");
}

.xp-digit-3 {
  background-image: url("/static/img/xp-digit-3.png?v=XAEEljleLcQv");
}

.xp-digit-4 {
  background-image: url("/static/img/xp-digit-4.png?v=eLw8r7xH_81l");
}

.xp-digit-5 {
  background-image: url("/static/img/xp-digit-5.png?v=Ke0LyBHxaSbN");
}

.xp-digit-6 {
  background-image: url("/static/img/xp-digit-6.png?v=1jZAjA3xc9NB");
}

.xp-digit-7 {
  background-image: url("/static/img/xp-digit-7.png?v=uuh5MM5KgpdI");
}

.xp-digit-8 {
  background-image: url("/static/img/xp-digit-8.png?v=1Heyoh_p0Oyf");
}

.xp-digit-9 {
  background-image: url("/static/img/xp-digit-9.png?v=8Bnj8YKqGrBp");
}

/* The empty bar: drawn 8px round (its 4px caps at 2x), its fill 2px in (its outline). */

.xp-bar {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 12px;
  top: 8px;
  box-sizing: border-box;
  width: 148px;
  height: 16px;
  border: 1px solid transparent;
  border-image: url("/static/img/xp-bar.png?v=USxkE8mUZ-zz") 4 fill / 8px stretch;
  background: none;
  image-rendering: pixelated;
}

.xp-bar::-webkit-progress-bar {
  background: none;
}

/* The fill: its 2px caps at 4px, its middle stretched. */

.xp-bar::-webkit-progress-value {
  border-image: url("/static/img/xp-fill.png?v=jCXwXGlb84BF") 0 2 fill / 0 4px stretch;
  background: none;
}

.xp-bar::-moz-progress-bar {
  border-image: url("/static/img/xp-fill.png?v=jCXwXGlb84BF") 0 2 fill / 0 4px stretch;
  background: none;
}

.xp-text {
  text-align: center;
  margin: 4px 0 8px;
}

/* --- Inbox & messages ------------------------------------------------------------------- */

/* A count: unread messages and requests on the Inbox link, open reports on an admin's. */

.badge {
  color: var(--ink);
}

/* A row of one-button forms (accept, decline, block...). */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

form.action {
  margin: 0;
}

.actions + p {
  margin-top: 6px;
}

.threads {
  margin: 0;
  padding: 0;
  list-style: none;
}

.threads li {
  border-bottom: 1px solid var(--line);
}

.threads li:last-child {
  border-bottom: 0;
}

.threads a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  color: var(--ink);
}

.threads a:hover {
  text-decoration: none;
  background: linear-gradient(#fff, #e3f2fd);
}

.thread-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-name {
  overflow: hidden;
  font-weight: bold;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The time sits at the right end of the name's line. */
.thread-head .hint {
  margin-left: auto;
  white-space: nowrap;
}

.threads .is-unread .thread-name {
  color: var(--link);
}

.thread-last {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.msg {
  align-self: flex-start;
  max-width: 85%;
  padding: 6px 12px;
  text-align: left;
  border: 1px solid var(--muted);
}

.msg-mine {
  align-self: flex-end;
  border-color: var(--link-dim);
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.msg-from {
  font-family: var(--font);
  color: var(--link);
}

.msg-head .hint {
  margin: 0;
}

/* Players' words: plain text, their line breaks kept, long words wrapped. A very tall one scrolls on its own. */

.msg-body {
  max-height: 320px;
  margin: 0;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.older {
  text-align: center;
}

.msg-body + form,
.chat + form {
  margin-top: 12px;
}

/* The small report icon on other players' messages and profiles: quiet until pointed at. */

.report-link {
  display: inline-flex;
  opacity: 0.5;
}

.report-link:hover,
.report-link:focus-visible {
  opacity: 1;
}

.msg-head .report-link,
.msg-head .msg-reported {
  margin-left: auto;
}

.bar-end {
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
}

.widget-bar .report-done {
  color: rgb(255 255 255 / 0.85);
}

.widget-foot .send,
.widget-foot .send-closed {
  flex: 1;
  margin: 0;
}

.send {
  flex-direction: row;
  align-items: flex-end;
}

.send textarea {
  flex: 1;
}

.send-closed p {
  margin: 0 0 6px;
}

/* --- Admin panel ---------------------------------------------------------------------- */

/* The panel's own links, above its pages. */

.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 16px;
  margin: 0 0 12px;
}

.subnav a.is-active {
  color: var(--ink);
}

.admin-table td {
  vertical-align: top;
}

.admin-table th:first-child {
  width: 40%;
}

/* One row a day: the date, a bar, the count. */

.daily {
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 6px;
}

.editor-grid {
  grid-template-columns: minmax(0, 1fr) 264px;
}

.editor input:not([type="checkbox"]),
.editor select,
.editor textarea {
  width: 100%;
}

.editor #body {
  min-height: 320px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-row > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slug-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slug-field span {
  white-space: nowrap;
}

.editor .slug-field input {
  flex: 1;
  width: auto;
  min-width: 0;
}

.slug-fixed {
  margin: 0;
}

.counter {
  float: right;
  align-self: flex-end;
}

.counter.over {
  color: var(--bad);
}

.problems {
  padding: 6px 12px;
  color: var(--bad);
  border: 1px solid;
}

.problems p,
.problems ul {
  margin: 0;
  color: inherit;
}

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.md-toolbar[hidden] {
  display: none;
}

.editor-buttons {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.preview {
  margin-bottom: 12px;
  outline: 2px solid var(--link-dim);
  outline-offset: 8px;
}

.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.upload input {
  max-width: 100%;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border: 1px solid var(--line);
}

.gallery img {
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.gallery li > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.gallery-big img {
  width: 72px;
  height: 72px;
}

.gallery p {
  margin: 0;
}

.md-help {
  width: 100%;
  border-collapse: collapse;
}

.md-help td {
  padding: 0 6px;
  vertical-align: top;
  border: 1px solid var(--line);
}

/* --- Guilds ------------------------------------------------------------------------------ */

/* A guild's tag, as the game shows it before its members' names. */

.guild-tag {
  font-family: var(--font);
  color: var(--link);
}

/* What the guild wrote about itself: plain text, its line breaks kept. */

.guild-about {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* A guild's top container: name, description, details and membership, each in a section of its own. */

/* The guild list: names and descriptions, the description taking what room there is. */

.guild-list .guild-desc {
  overflow-wrap: anywhere;
}

.guild-list td:last-child {
  white-space: nowrap;
}

.guild-search {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 12px 12px 0;
}

.guild-search > div {
  display: flex;
  flex-direction: column;
}

.guild-search .field-q {
  flex: 1 1 160px;
}

.guild-search label.check {
  align-self: flex-end;
  height: 28px;
  align-items: center;
}

.guild-members .actions {
  justify-content: center;
}

/* Names (a guild's, a member's with their online dot) stay on one line. */

.guild-list td:first-child,
.guild-members td:first-child {
  white-space: nowrap;
}

/* Each choice's explanation under it, not squeezed beside it. */

fieldset.choices label.check {
  flex-wrap: wrap;
}

fieldset.choices label.check .hint {
  flex-basis: 100%;
  padding-left: 22px;
}

.rank-4 {
  color: var(--link);
}

.rank-3 {
  color: var(--link-dim);
}

.rank-1 {
  color: var(--muted);
}

/* Leagues, by a guild's power (guilds.ts). */

.league-bronze {
  background: linear-gradient(#e0a869, #9a5b1a);
}

.league-silver {
  background: linear-gradient(#d3d7dc, #7c8187);
}

.league-gold {
  background: linear-gradient(#f6cf5a, #b58200);
}

.league-platinum {
  background: linear-gradient(#86dde0, #2f8f92);
}

.league-diamond {
  background: linear-gradient(#94acff, #3f58c4);
}

.widget-note {
  margin: 0;
  padding: 12px 12px 0;
  color: var(--muted);
}

.profile-guild {
  margin: 6px 0;
}

input.short {
  width: 6em;
}

form.danger-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/*
 * --- Moderation ----------------------------------------------------------------------------
 * The admins' box under a player's profile, and the admin panel's player list.
 */

.moderation {
  margin-top: 12px;
}

.player-search {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.player-search > div {
  display: flex;
  flex-direction: column;
}

.player-search .field-q {
  flex: 1 1 160px;
}

.scores.players td {
  vertical-align: middle;
}

.scores.players .email {
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

form.quick-ban {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.quick-ban input {
  width: 120px;
}

/* Wide tables scroll sideways on a phone, rather than the page. */

.table-scroll {
  position: relative;
  overflow-x: auto;
}

.table-scroll .scores {
  min-width: 720px;
}

form.mod-form button {
  align-self: center;
}

.moderation form.action {
  align-items: flex-start;
}

.table-scroll + .pager {
  padding: 6px;
}

.sanctions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sanctions li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.sanctions li:last-child {
  border-bottom: 0;
}

.sanctions .hint {
  overflow-wrap: anywhere;
}

fieldset.choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.choices legend {
  padding: 0;
  color: var(--muted);
}

.tag-ban,
.tag-game_ban {
  color: var(--bad);
}

.tag-mute,
.tag-limit,
.tag-unconfirmed {
  color: var(--muted);
}

.tag + .tag {
  margin-left: 6px;
}

details.add-ban summary {
  cursor: pointer;
  margin: 6px 0;
  color: var(--link);
}

.restrictions {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}

/*
 * --- Icons -------------------------------------------------------------------------------
 * 16x16 art drawn at its own size. `icon-tab-<section>`
 * in the header, `icon-enemy-<name>` beside kill counts, `icon-report` on reports.
 * Art: static/img/icon-<name>.png.
 */

.icon {
  flex: none;
  display: inline-block;
  width: 16px;
  height: 16px;
  background: center / 100% 100% no-repeat;
  image-rendering: pixelated;
}

/* Real pictures fill their slot without stretching. */

img.art {
  object-fit: cover;
}

/*
 * --- Art slots ---------------------------------------------------------------------------
 * One class per slot, sized here (inline styles are blocked by the CSP). An
 * <img class="art art-<slot>"> takes the same size; so does
 * static/img/art-<slot>.png, filled in automatically. Sizes are multiples of
 * the art's own pixels: the logo is 112x32 art pixels.
 */

.art {
  display: block;
  flex: none;
  max-width: 100%;
  image-rendering: pixelated;
  background: center / contain no-repeat;
}

/* Until there's a picture: a plain frame with its name. */

.art-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--muted);
}

.art-logo {
  width: 336px;
  height: 96px;
}

.art-news {
  width: 100%;
  height: 200px;
}

.art-thumb {
  width: 96px;
  height: 72px;
}

.art-hero {
  width: 100%;
  height: 200px;
}

.art-panorama {
  width: 100%;
  height: 160px;
}

.art-comic {
  width: 100%;
  height: 300px;
}

/* --- Footer --------------------------------------------------------------------------- */

.footer {
  text-align: center;
  padding: 12px 8px 16px;
  font-size: 11px;
  color: #285a88;
}

.footer p {
  margin: 0;
}

/* --- Small screens ---------------------------------------------------------------------- */

@media (max-width: 900px) {
  .grid-front {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "mid mid"
      "left right";
  }

  .grid-profile {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas:
      "card record"
      "friends friends";
  }



  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-3 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .grid-front {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "mid"
      "left"
      "right";
  }

  .grid-side,
  .grid-side-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {


  .grid-profile,
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-profile {
    grid-template-areas: "card" "record" "friends";
  }

  .headlines li .art {
    display: none;
  }

}

/* The logo steps down to 2x, never to a size between. */

@media (max-width: 400px) {
  .brand,
  .art-logo {
    width: 224px;
    height: 64px;
  }
}

.stack,
.zone,
.grid-front,
.grid-profile,
.grid-side,
.grid-2,
.grid-3 {
  gap: 8px;
}

input,
select,
textarea {
  height: 22px;
  padding: 1px 4px;
  font: 12px/16px var(--font);
  color: var(--ink);
  background: #fff;
  border: 1px solid #7fa8cc;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgb(0 60 120 / 0.2);
}

.scores th:first-child,
.scores td:first-child {
  width: 36px;
  text-align: center;
}

@media (max-width: 760px) {
  .grid-profile,
  .grid-side,
  .grid-side-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tools > .tool:first-of-type {
  border-left-width: 1px;
  border-radius: 13px 0 0 13px;
}

.tools > .tool:last-of-type {
  border-radius: 0 13px 13px 0;
}

.tool:hover {
  text-decoration: none;
  color: #0b4f9a;
  background: linear-gradient(#fff 0, #f4faff 48%, #e2f1fd 52%, #f3faff 100%);
}

button:hover,
.button:hover,
input[type="file"]::file-selector-button:hover {
  color: #17400a;
  background: linear-gradient(#f4ffd9 0, #c4f58c 48%, #98e24f 52%, #cbf79c 100%);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgb(70 160 240 / 0.5);
}

.scores th {
  color: #1d4e7e;
  font-weight: normal;
  background: linear-gradient(#f6fbff, #cfe6f8);
}

.scores td {
  border-color: #dbe9f5;
}

.scores tbody tr:nth-child(odd) td {
  background: #fff;
}

.scores tbody tr:nth-child(even) td {
  background: #eef7fe;
}

.stat-list dt {
  background: #eef7fe;
}

.menu a:hover,
.index li:hover {
  background: linear-gradient(#fff, #cfe8fc);
  text-decoration: none;
}

.menu a.is-active {
  color: #fff;
  background: linear-gradient(#6cc3ff, #1f8be0);
}

/* Names lead their tables; only rank numbers are centred. */

.guild-list th:first-child,
.guild-list td:first-child {
  width: auto;
}

/* A button or note straight after a table needs a little air. */

.stat-list + form,
.stat-list + p {
  margin-top: 8px;
}

/* On a phone the links wrap onto lines of their own: separate pills, not a broken-up bar. */

@media (max-width: 560px) {
  .tools {
    gap: 4px;
  }

  .tool,
  .tools > .tool:first-of-type,
  .tools > .tool:last-of-type {
    border-left-width: 1px;
    border-radius: 13px;
  }
}

/* --- Guild pages -------------------------------------------------------------------------- */

/* A title with parts in it (tag, name, rank) reads left to right. */

.widget-bar.is-left,
.widget-bar.is-left h2 {
  text-align: left;
}

.widget-bar.is-left h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.widget-bar.is-left .guild-tag {
  color: #fff;
}

/* A pill on a blue title bar is frosted glass, so it shows. */

.widget-bar .tag {
  background: rgb(255 255 255 / 0.28);
  border: 1px solid rgb(255 255 255 / 0.75);
  text-shadow: 0 1px 1px rgb(0 40 90 / 0.6);
}

/* A guild's top: its description in a box, and beside it what the viewer can do about joining or leaving. */

.guild-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 8px;
  align-items: stretch;
}

.guild-box {
  min-width: 0;
  padding: 8px;
  background: #f6fbff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgb(0 60 120 / 0.12);
}

.guild-box > :last-child {
  margin-bottom: 0;
}

.guild-actions-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
}

.guild-actions-box p {
  margin: 0;
}

.guild-actions-box form {
  margin: 0;
}

.guild-actions-box .button,
.guild-actions-box button {
  display: block;
}

/* Its numbers, along the foot of the window. */

.guild-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  width: 100%;
  margin: 0;
  text-align: left;
}

.guild-facts div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guild-facts dt {
  color: var(--muted);
}

.guild-facts dd {
  margin: 0;
}

/* The guilds page: yours, as one row that opens it. */

.guild-mine {
  display: grid;
  grid-template-columns: 220px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--ink);
  text-align: left;
}

.guild-mine:hover {
  text-decoration: none;
  background: linear-gradient(#fff, #e3f2fd);
}

.guild-mine-name {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-mine-about {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: left;
}

.guild-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: center;
}

.guild-mine-about {
  color: var(--muted);
}

.guild-mine-meta {
  white-space: nowrap;
}

/* The guilds to join: a row each, a button that opens the guild; every row the same height, whatever its description. */

.guild-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 76px 92px 72px;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 12px;
  color: var(--ink);
  text-align: center;
  border-top: 1px solid var(--line);
}

a.guild-row:hover {
  text-decoration: none;
  background: linear-gradient(#fff, #e3f2fd);
}

.guild-head {
  height: auto;
  padding: 4px 12px;
  font-weight: bold;
  color: var(--link-dim);
  border-top: 0;
  background: linear-gradient(#f2faff, #d3e9f9);
}

.guild-row .guild-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-row .guild-desc {
  line-height: 1.3;
}

/* A box whose whole area opens its link: the link in the footer stretches over it. */

.widget.is-link {
  position: relative;
}

.widget.is-link .widget-foot a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.widget.is-link:hover .widget-body,
.widget.is-link:focus-within .widget-body {
  background: linear-gradient(#fff, #e3f2fd);
}

.widget.is-link:hover .widget-foot {
  background: linear-gradient(#e6f4fc, #bfdcf3);
}

/* The Slain table keeps each enemy on one line. */

.slain th:first-child,
.slain td:first-child {
  width: 65%;
  white-space: nowrap;
}

/* --- Messages ---------------------------------------------------------------------------- */

.back-row {
  margin: 0 0 8px;
}

/* Bubbles, as in an old instant messenger or phone: rounded and glossy, yours blue, theirs green. */

.chat {
  gap: 10px;
}

.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: 85%;
  padding: 0;
  border: 0;
  background: none;
}

.msg-mine {
  align-items: flex-end;
}

.msg-head {
  margin: 0 8px;
}

.msg-from {
  color: #2e7a12;
}

.msg-mine .msg-from {
  color: var(--link);
}

.msg-body {
  display: block;
  max-width: 100%;
  padding: 6px 12px;
  color: #1d4a0a;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.5);
  background: linear-gradient(#f0ffdb 0, #b9ef7e 48%, #92dd48 52%, #bdf186 100%);
  border: 1px solid #5fae2a;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.85), 0 1px 3px rgb(0 70 0 / 0.3);
}

.msg-mine .msg-body {
  color: #fff;
  text-shadow: 0 1px 1px rgb(0 40 90 / 0.6);
  background: linear-gradient(#9bdbff 0, #46aff2 48%, #1b86dc 52%, #4fb6f4 100%);
  border-color: #1a78c8;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7), 0 1px 3px rgb(0 60 140 / 0.35);
}

/* The box you write in is one size: no handle to drag it, and what it takes is capped by its maxlength. */

.send textarea {
  height: 72px;
  min-height: 72px;
  resize: none;
  overflow-y: auto;
}

/* The player you're talking to: picture under their name, then one button a line. */

.side-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.side-actions form {
  margin: 0;
}

.side-actions .button,
.side-actions button {
  display: block;
  width: 100%;
}

@media (max-width: 560px) {
  .guild-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .guild-mine {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .guild-mine-about {
    grid-column: 1 / -1;
  }

  .guild-row {
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding: 6px 12px;
  }

  .guild-row .guild-desc,
  .guild-row .button,
  .guild-head {
    display: none;
  }
}

/* Rank arrows: small and quiet, either side of the rank (down demotes, up promotes). */

.rank-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.rank-cell form {
  display: inline-flex;
  margin: 0;
}

button.arrow {
  min-width: 16px;
  padding: 0 2px;
  color: var(--link-dim);
  font-size: 10px;
  line-height: 16px;
  text-shadow: none;
  background: none;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
}

button.arrow:hover {
  color: #fff;
  background: linear-gradient(#6cc3ff, #1f8be0);
}

.arrow-gap {
  display: inline-block;
  width: 16px;
}

/* A destructive button is red. */

/* The member table: rank first and as narrow as its text and arrows, the name taking the room, the buttons at the right. */

.guild-members td.col-actions {
  text-align: center;
}

.guild-members .actions {
  flex-wrap: nowrap;
  justify-content: center;
}

/* A profile's record: the thing, its number and its place, each in its own column, the kills under them. */

.scores.record {
  table-layout: fixed;
}

.scores.record .col-label {
  width: 50%;
}

.scores.record th:first-child,
.scores.record td:first-child {
  width: auto;
}

.scores.record th[scope="row"] {
  color: var(--ink);
  font-weight: normal;
  background: #eef7fe;
}

.scores.record .kill-name .icon {
  margin-right: 6px;
  vertical-align: middle;
}

/* A friend: the name at the left and its buttons at the right of the same row. */

.friends li .actions {
  flex: none;
  margin-left: auto;
  flex-wrap: nowrap;
}

.friends li .friend-name {
  flex: 1 1 auto;
}

/* Tick boxes and radio buttons: white inside, a blue tick, in the same Aero as the rest. */

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  background: #fff;
  border: 1px solid #7fa8cc;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgb(0 60 120 / 0.2);
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: linear-gradient(#8dd4ff 0, #3fa6f0 48%, #1b86dc 52%, #46b3f3 100%);
  border-color: #1a78c8;
}

input[type="checkbox"]:checked::before {
  content: "";
  width: 3px;
  height: 7px;
  margin-top: -1px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"]:checked::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

/*
 * Drop-down lists. The option you point at is highlighted by the browser (blue with white text),
 * so options get no background of their own, or it would hide that highlight and leave white text
 * on white. Only the chosen option is styled, to match.
 */
select option:checked {
  color: var(--ink);
  background-color: #d4e8f9;
  background-image: linear-gradient(#d4e8f9, #d4e8f9);
}

::selection {
  color: var(--ink);
  background: #b9dcf7;
}

/*
 * Players' pictures: the game's 40x40 art at 2x (80x80), in a frame a little darker than
 * the window it sits in, so it isn't just floating on white. A character that has no picture
 * yet gets the same frame, with its name.
 */
.art-portrait,
.art-portrait-row,
.art-doll,
.art-doll-big {
  box-sizing: content-box;
  width: 80px;
  height: 80px;
  margin: 0 auto 6px;
  padding: 4px;
  background: linear-gradient(#e2eff9, #c4dbee);
  border: 1px solid #9fc0dc;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgb(0 60 120 / 0.25), 0 1px 0 #fff;
  object-fit: contain;
}

.art-portrait-small {
  margin: 0;
}

/* A row's picture: the same frame at 1x, small enough for a line of the message list. */
.art-portrait-row {
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 3px;
}

.art-portrait-row.art-empty span {
  display: none;
}

.art-doll,
.art-doll-big {
  font-size: 11px;
  line-height: 14px;
}

/* The member table: rank, joined and the button each get room to breathe, the name takes the rest. */
.guild-members td.col-rank,
.guild-members th.col-rank {
  width: 150px;
  white-space: nowrap;
}

.guild-members td.col-joined,
.guild-members th.col-joined {
  width: 130px;
  white-space: nowrap;
}

.guild-members td.col-actions,
.guild-members th.col-actions {
  width: 110px;
  white-space: nowrap;
}

/* The online dot has room before the name. */
.scores .dot {
  margin-right: 10px;
}

/* Menus and friend lists: no bullets or indent, a rule between rows and none after the last. */
.menu,
.friends {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a,
.friends li {
  border-bottom: 1px solid var(--line);
}

.menu li:last-child a,
.friends li:last-child {
  border-bottom: 0;
}

/* The page you're on stays blue when pointed at: just a little lighter. */
.tool.is-active:hover {
  color: #fff;
  background: linear-gradient(#97d5ff 0, #4aa6ee 48%, #2688dc 52%, #5cb6f4 100%);
}

/*
 * The little arrows on a number box, in the theme's blue instead of the browser's black. Drawn with
 * gradients (a triangle is a 45 degree wedge of a conic gradient), always showing, not just on hover.
 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 20px;
  margin: 0;
  opacity: 1;
  cursor: pointer;
  background:
    conic-gradient(from 135deg at 50% 0%, var(--link-dim) 0 90deg, transparent 0) center calc(50% - 4px) / 8px 4px no-repeat,
    conic-gradient(from -45deg at 50% 100%, var(--link-dim) 0 90deg, transparent 0) center calc(50% + 4px) / 8px 4px no-repeat;
}

input[type="number"]::-webkit-inner-spin-button:hover {
  background:
    conic-gradient(from 135deg at 50% 0%, var(--link) 0 90deg, transparent 0) center calc(50% - 4px) / 8px 4px no-repeat,
    conic-gradient(from -45deg at 50% 100%, var(--link) 0 90deg, transparent 0) center calc(50% + 4px) / 8px 4px no-repeat;
}

/* The unread count inside the selected nav button must stay readable on the blue. */
.tool.is-active .badge {
  color: #fff;
}

/* The account settings page: one wide column of boxes; each a row with small buttons at its right end. */

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  text-align: left;
}

.account-buttons {
  display: flex;
  gap: 8px;
}

.account-buttons form {
  margin: 0;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
  text-align: center;
}

.account-form > div {
  min-width: 0;
}

.account-submit {
  margin: 4px 0 0;
}

.account-form label {
  display: block;
  margin-bottom: 2px;
}

.account-form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Enemy names lead their tables, left-aligned so their icons line up. */

.slain th:first-child,
.slain td:first-child,
.scores.record td.kill-name {
  padding-left: 16px;
  text-align: left;
}

/* The site's own account: a framed icon for a picture, and its thread set apart. */

.system-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  background: linear-gradient(#e2eff9, #c4dbee);
  border: 1px solid #9fc0dc;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgb(0 60 120 / 0.25), 0 1px 0 #fff;
}

.system-portrait-row {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 3px;
}

.system-portrait {
  margin: 0 auto 6px;
}

.system-portrait-row {
  margin: 0;
}

.thread-official {
  background: #f3f9fe;
}

.thread-head .tag {
  flex: none;
}

.system-portrait:not(.system-portrait-row) {
  width: 80px;
  height: 80px;
  padding: 4px;
}

/* The admin's message forms: fields the full width, the button its own size at the left. */

.site-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-form textarea {
  resize: vertical;
}

.site-form button {
  align-self: flex-start;
  margin-top: 4px;
}

/* The site account's picture: static/img/icon-system.png (a placeholder until the logo is added), filling its frame. */

.system-logo {
  width: 100%;
  height: 100%;
  background-size: contain;
}

/* A badge (Official, Admin) under a picture, centred in its box. */

.badge-row {
  text-align: center;
}

/* Art found in static/img at startup. */
.art-logo { background: url("/static/img/art-logo.png?v=5LH0CvQv-Y8a") center / contain no-repeat; border: 0; }
.art-logo > span { visibility: hidden; }
.icon-enemy-blue_slime { background-image: url("/static/img/icon-enemy-blue_slime.png?v=InPpWvq7sU3e"); }
.icon-enemy-large_blue_slime { background-image: url("/static/img/icon-enemy-large_blue_slime.png?v=InPpWvq7sU3e"); }
.icon-enemy-large_slime { background-image: url("/static/img/icon-enemy-large_slime.png?v=hAQJ5W4FCSqz"); }
.icon-enemy-slime { background-image: url("/static/img/icon-enemy-slime.png?v=hAQJ5W4FCSqz"); }
.icon-report { background-image: url("/static/img/icon-report.png?v=srxUHW_LMazc"); }
.icon-system { background-image: url("/static/img/icon-system.png?v=ycERTRvwPWKv"); }
.icon-tab-front { background-image: url("/static/img/icon-tab-front.png?v=mcQ1Ng0SCvIa"); }
.icon-tab-guilds { background-image: url("/static/img/icon-tab-guilds.png?v=srxUHW_LMazc"); }
.icon-tab-hiscores { background-image: url("/static/img/icon-tab-hiscores.png?v=9TmqYqX1DC_H"); }
.icon-tab-inbox-mail { background-image: url("/static/img/icon-tab-inbox-mail.png?v=UGivvYAdgBCI"); }
.icon-tab-inbox { background-image: url("/static/img/icon-tab-inbox.png?v=abZ4kFFQnAhe"); }
.icon-tab-login { background-image: url("/static/img/icon-tab-login.png?v=WbJFs5TNF5ow"); }
.icon-tab-news { background-image: url("/static/img/icon-tab-news.png?v=DBEsZ1OdnvUw"); }
.icon-tab-play { background-image: url("/static/img/icon-tab-play.png?v=SvnaxXbEbCNC"); }
.icon-tab-profile { background-image: url("/static/img/icon-tab-profile.png?v=IXCklGWpp8OZ"); }
.icon-tab-stats { background-image: url("/static/img/icon-tab-stats.png?v=nAraeJ0q1Alx"); }
.icon-table-blue_slime { background-image: url("/static/img/icon-table-blue_slime.png?v=InPpWvq7sU3e"); }
.icon-table-bosses { background-image: url("/static/img/icon-table-bosses.png?v=U3ks31sB_nQw"); }
.icon-table-enemies { background-image: url("/static/img/icon-table-enemies.png?v=Ymi-EP9iMEWU"); }
.icon-table-large_blue_slime { background-image: url("/static/img/icon-table-large_blue_slime.png?v=InPpWvq7sU3e"); }
.icon-table-large_slime { background-image: url("/static/img/icon-table-large_slime.png?v=hAQJ5W4FCSqz"); }
.icon-table-overall { background-image: url("/static/img/icon-table-overall.png?v=NwN4C7atyYAU"); }
.icon-table-pvp { background-image: url("/static/img/icon-table-pvp.png?v=H7fnu8poSoA0"); }
.icon-table-slime { background-image: url("/static/img/icon-table-slime.png?v=hAQJ5W4FCSqz"); }
