:root {
  --sky: #dff7ff;
  --blue: #1477c9;
  --blue-dark: #064b9f;
  --blue-soft: #8fc9ef;
  --panel: rgba(226, 246, 255, .92);
  --panel-strong: #bfe4fb;
  --ink: #073866;
  --muted: #496b86;
  --line: #3e91d3;
  --gold: #ffbd38;
  --orange: #ff7a31;
  --white: #ffffff;
  --shadow-hard: rgba(0, 29, 91, .28);
  --shadow-soft: rgba(0, 69, 120, .22);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .82), transparent 34rem),
    linear-gradient(180deg, #e9fbff 0, #d7f4ff 42%, #eefaff 100%);
}

.site-error {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: #e5f7ff;
}

.site-error .panel {
  max-width: 680px;
}

body.has-page-hero::before {
  content: "";
  position: absolute;
  inset: 48px 0 auto;
  height: 260px;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(229, 251, 255, .32), rgba(215, 244, 255, .82) 55%, #d7f4ff 100%),
    url("assets/hero-town.png") center 42% / cover no-repeat;
}

body.is-admin.has-page-hero::before {
  background:
    linear-gradient(180deg, rgba(10, 9, 8, .22), rgba(16, 13, 11, .7) 44%, #11100f 100%),
    url("assets/backend-gear.png") center 48% / cover no-repeat;
}

body.is-profile-backend.has-page-hero::before {
  background:
    linear-gradient(180deg, rgba(10, 9, 8, .22), rgba(16, 13, 11, .7) 44%, #11100f 100%),
    url("assets/backend-gear.png") center 48% / cover no-repeat;
}

body.is-admin,
body.is-profile-backend {
  --ink: #2f1809;
  --muted: #6b4b34;
  --line: #c45a12;
  --shadow-hard: rgba(0, 0, 0, .46);
  --shadow-soft: rgba(0, 0, 0, .36);
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 159, 69, .2), transparent 33rem),
    linear-gradient(180deg, #171412 0, #0f0e0d 46%, #18110d 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  position: relative;
  z-index: 1;
  width: min(1190px, 100% - 24px);
  margin: 0 auto;
}

body.has-page-hero main {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 92px;
}

.page-menu {
  grid-column: 1;
  position: static;
  width: 100%;
  margin-top: var(--page-menu-offset, 0);
}

body.is-admin .page-menu {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 76px);
  overflow: auto;
}

.page-content {
  grid-column: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding: 4px max(14px, calc((100vw - 1190px) / 2));
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  border-bottom: 2px solid rgba(62, 145, 211, .32);
  box-shadow: 0 4px 14px var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 900;
  color: #004f99;
  text-shadow: 0 1px 0 #fff;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border: 2px solid #fff;
  border-radius: 5px;
  color: #642b00;
  font-weight: 900;
  background: linear-gradient(180deg, #ffd870, #ff8a35);
  box-shadow: 0 3px 0 var(--shadow-hard);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.nav a:hover {
  background: linear-gradient(180deg, #ffe394, #ff9c45);
}

.flash {
  position: fixed;
  top: 54px;
  left: 50%;
  z-index: 40;
  width: min(760px, calc(100% - 28px));
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #ffcf65;
  border-radius: 6px;
  background: #fff4c8;
  color: #85520a;
  font-weight: 800;
  box-shadow: 0 8px 0 var(--shadow-hard), 0 18px 38px var(--shadow-soft);
  transform: translateX(-50%);
  animation: flashToast 10s ease forwards;
}

@keyframes flashToast {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  6%,
  84% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
  }
}

.hero {
  position: relative;
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 240px 1fr 210px;
  align-items: center;
  gap: 24px;
  margin: 0 calc(50% - 50vw);
  padding: 70px max(28px, calc((100vw - 1190px) / 2)) 110px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(229, 251, 255, .28), rgba(229, 251, 255, .62) 62%, rgba(215, 244, 255, .96)),
    url("assets/hero-town.png") center bottom / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(180deg, transparent, rgba(215, 244, 255, .74) 52%, #d7f4ff 100%);
  pointer-events: none;
}

.quest-board {
  position: relative;
  z-index: 2;
  align-self: center;
  border: 4px solid #083d91;
  border-radius: 8px;
  background: #eef8ff;
  box-shadow: 0 8px 0 var(--shadow-hard), 0 18px 38px var(--shadow-soft);
  overflow: hidden;
}

.quest-board.page-menu {
  align-self: start;
  overflow: visible;
}

.quest-board h2 {
  margin: 0;
  padding: 13px 14px;
  color: #fff;
  background: linear-gradient(180deg, #087dd8, #004bb1);
  font-size: 1.05rem;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.quest-board a {
  display: block;
  margin: 10px;
  padding: 13px 12px;
  border: 1px solid #b6c9dd;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff, #dce8f4);
  color: #234d9d;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.quest-board .menu-subtitle {
  margin-top: 14px;
  border-top: 1px solid rgba(16, 75, 143, .22);
}

.quest-board a.is-disabled-menu-item {
  opacity: .72;
  border-style: dashed;
}

.quest-board a.active-menu {
  border-color: #073d94;
  background: linear-gradient(180deg, #dff3ff, #b9d9f0);
  color: #004f99;
}

body.is-admin .quest-board.page-menu {
  border-color: #f05b24;
  background: #ffffff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .48), 0 18px 38px rgba(0, 0, 0, .36);
  overflow: visible;
}

body.is-admin .quest-board.page-menu h2 {
  color: #fff8ef;
  background: linear-gradient(180deg, #d86422, #9b3710);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .46);
}

body.is-admin .quest-board.page-menu a {
  border-color: #d86422;
  background: linear-gradient(180deg, #fff8ef, #ead0b7);
  color: #4c2108;
}

body.is-admin .quest-board.page-menu a.active-menu {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #f07a2a);
  color: #4c2108;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
  justify-self: center;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 28px;
  color: #fff;
  background: linear-gradient(180deg, #2194db, #0767bf);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 6px 0 0 #6ed7ff, -6px 0 0 #6ed7ff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.hero h1 {
  margin: 0;
  color: #0062c9;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #fff,
    0 -4px 0 #fff,
    4px 0 0 #fff,
    -4px 0 0 #fff,
    0 9px 0 #74d9ff,
    0 18px 28px rgba(0, 57, 139, .28);
}

.hero p {
  max-width: 680px;
  margin: 28px auto;
  color: #113c63;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.55;
  text-shadow: 0 1px 0 #fff;
}

.actions,
.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}

.hero .actions {
  justify-content: center;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 2px solid #fff;
  border-radius: 5px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #ffd870, #ff8a35);
  color: #642b00;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--shadow-hard), 0 0 0 1px rgba(0, 69, 120, .16);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.button.primary,
button.primary,
.pixel-button {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd870, #ff8a35);
  color: #642b00;
  box-shadow: 0 4px 0 var(--shadow-hard), 0 0 0 1px rgba(0, 69, 120, .16);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.pixel-button.blue {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd870, #ff8a35);
  color: #642b00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.hero-badges {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: end;
  gap: 18px;
}

.round-home,
.download-badge {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .38);
  box-shadow: 0 8px 0 var(--shadow-hard);
}

.round-home {
  width: 62px;
  height: 62px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffcf47, #f05b24);
  font-size: 2rem;
}

.download-badge {
  min-width: 180px;
  min-height: 58px;
  border: 4px solid #073d94;
  border-radius: 28px;
  background: linear-gradient(180deg, #4ee1ff, #0363c5 64%, #004198);
}

.quick-grid,
.card-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.quick-grid {
  position: relative;
  z-index: 3;
  margin-top: -78px;
  padding-bottom: 18px;
}

.quick-card,
.card,
.panel,
.story,
.post,
.table-row,
.map-stage,
.profile-head {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 0 var(--shadow-hard), 0 18px 35px var(--shadow-soft);
}

.quick-card {
  padding: 18px;
  color: #07417a;
  background: linear-gradient(180deg, #fff, #cbeeff);
}

.quick-card strong {
  display: block;
  color: #006fc8;
  font-size: 2.15rem;
  text-shadow: 0 2px 0 #fff;
}

.quick-card span,
small,
.page-title p {
  color: var(--muted);
}

body.is-admin .admin-dashboard .quick-card {
  border-color: #f05b24;
  background: linear-gradient(180deg, #fff7ed, #edd3bd);
  color: #66300c;
}

body.is-admin .admin-dashboard .quick-card strong {
  color: #d84f18;
}

body.is-admin .admin-dashboard .quick-card span {
  color: #74421f;
}

body.is-admin .site-header {
  border-bottom-color: rgba(196, 90, 18, .42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
}

body.is-admin .brand {
  color: #4c2108;
}

body.is-admin .page-title h1,
body.is-admin .section-head h2 {
  color: #ffb15f;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .46);
}

body.is-admin .page-title p {
  color: #f0d0b3;
}

body.is-admin .quick-card,
body.is-admin .card,
body.is-admin .panel,
body.is-admin .story,
body.is-admin .post,
body.is-admin .table-row,
body.is-admin .map-stage,
body.is-admin .profile-head {
  border-color: #c45a12;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .48), 0 18px 35px rgba(0, 0, 0, .34);
}

body.is-admin .panel,
body.is-admin .card,
body.is-admin .story,
body.is-admin .post,
body.is-admin .table-row,
body.is-admin .profile-head {
  background: #ffffff;
}

body.is-admin .panel h1,
body.is-admin .panel h2,
body.is-admin .card h3,
body.is-admin .story h2,
body.is-admin .detail-list dt,
body.is-admin .profile-public-facts dt,
body.is-admin .forum-author-facts dt,
body.is-admin .admin-row strong,
body.is-admin .table-row strong,
body.is-admin .linked-list a,
body.is-admin .card h3 a,
body.is-admin .detail-list a {
  color: #a43b0f;
}

body.is-admin .admin-dashboard .quick-card {
  border-color: #f05b24;
  background: linear-gradient(180deg, #fff8ef, #ecd0b6);
  color: #4c2108;
}

body.is-admin .admin-dashboard .quick-card strong {
  color: #d94c16;
}

body.is-admin .admin-dashboard .quick-card span {
  color: #5d3217;
}

body.is-admin input,
body.is-admin textarea,
body.is-admin select,
body.is-admin .rich-editor {
  border-color: #d86422;
  background: #fffaf3;
}

body.is-admin input:focus,
body.is-admin textarea:focus,
body.is-admin select:focus,
body.is-admin .rich-editor:focus-within {
  border-color: #168bd3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 139, 211, .24);
}

body.is-admin input[type="radio"],
body.is-admin input[type="checkbox"] {
  accent-color: #c45a12;
}

body.is-admin .rich-editor-toolbar {
  border-bottom-color: rgba(196, 90, 18, .34);
  background: #f3dcc6;
}

body.is-admin .rich-editor-toolbar button,
body.is-admin .category-choice label {
  border-color: #d86422;
  background: linear-gradient(180deg, #fff8ef, #ead0b7);
  color: #4c2108;
}

body.is-admin .admin-row,
body.is-admin .suggestion-row,
body.is-admin .detail-list div,
body.is-admin .forum-row {
  border-color: rgba(196, 90, 18, .26);
}

body.is-admin .empty-state.inline,
body.is-admin .forum-row {
  background: rgba(255, 248, 239, .68);
}

.section-head,
.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 16px;
}

.page-title {
  display: block;
  min-height: 0;
  padding: 0;
  margin-bottom: 18px;
}

.page-title h1,
.section-head h2 {
  margin: 0;
  color: #004f99;
  font-size: clamp(2rem, 4vw, 3.4rem);
  text-shadow: 0 3px 0 #fff;
}

.section-head a {
  color: #0068b9;
  font-weight: 900;
}

.card,
.story {
  overflow: hidden;
}

.card img,
.story img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #ffffff;
}

.card div,
.story div,
.panel,
.post,
.profile-head {
  padding: 18px;
}

.card h3,
.story h2,
.panel h1,
.panel h2 {
  color: #004f99;
}

.item-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.item-texture {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  image-rendering: pixelated;
  background: #ffffff;
  border: 1px solid rgba(62, 145, 211, .28);
  border-radius: 4px;
}

.page-title .item-texture {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}

.item-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  margin: 10px 0 14px;
  background: #ffffff;
  border: 1px solid rgba(62, 145, 211, .28);
  border-radius: 6px;
}

.item-detail .item-art {
  border: 0;
}

.edit-image-preview {
  display: grid;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 10px;
  border: 1px solid rgba(196, 90, 18, .28);
  border-radius: 6px;
  background: #fffaf3;
}

.edit-image-preview img {
  display: block;
  width: min(220px, 100%);
  max-height: 180px;
  object-fit: contain;
  image-rendering: auto;
}

.edit-image-preview.small img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.card p,
.story p,
.post p,
.profile-head p {
  color: var(--muted);
  line-height: 1.6;
}

.detail-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
  gap: 18px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(62, 145, 211, .2);
}

.detail-list dt {
  color: #004f99;
  font-weight: 900;
  overflow-wrap: normal;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list a,
.card h3 a,
.linked-list a {
  color: #005ca8;
  font-weight: 900;
}

.card-actions,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.card-actions .button,
.share-row .button {
  min-height: 36px;
  padding: 8px 14px;
}

.entity-detail {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 20px;
}

.entity-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(62, 145, 211, .28);
}

.entity-detail > div:only-child {
  grid-column: 1 / -1;
}

.linked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.linked-list a {
  border: 1px solid rgba(62, 145, 211, .35);
  border-radius: 5px;
  background: #ffffff;
  padding: 8px 12px;
}

.card small {
  display: block;
  margin-top: 7px;
}

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

.list-database {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 6px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 0 var(--shadow-hard), 0 18px 35px var(--shadow-soft);
}

.list-database .card {
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  border-bottom: 1px solid rgba(62, 145, 211, .24);
}

.list-database .card:last-child {
  border-bottom: 0;
}

.list-database .card > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.list-database .list-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  min-width: 0;
}

.list-database .item-texture,
.list-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}

.list-database .item-texture {
  background: #dff7ff;
  border: 1px solid #c45a12;
  border-radius: 4px;
}

.list-icon {
  background: #ffffff;
  border: 0;
  border-radius: 4px;
}

.list-icon.empty {
  background: rgba(62, 145, 211, .12);
}

.list-id {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.list-database .item-art,
.list-database .detail-list,
.list-database .card p,
.list-database .card > div > small {
  display: none;
}

.list-database .card-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.story-list,
.posts,
.table-list,
.forum-directory {
  display: grid;
  gap: 12px;
}

.forum-directory {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.forum-box p {
  color: var(--muted);
  line-height: 1.5;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-tile {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #004f99;
  text-align: left;
  box-shadow: 0 6px 0 var(--shadow-hard), 0 18px 35px var(--shadow-soft);
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
}

.gallery-tile span {
  font-weight: 900;
}

.gallery-tile small {
  color: var(--muted);
  font-weight: 800;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.filter-tabs .active {
  color: #ffffff;
  background: linear-gradient(180deg, #087dd8, #004bb1);
  border-color: #073d94;
  pointer-events: none;
}

.gallery-tile > button {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #004f99;
  text-align: left;
  box-shadow: none;
  text-shadow: none;
}

.card-image-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.card-image-button img {
  display: block;
}

.entity-image-button {
  align-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.guestbook-form,
.guestbook-list {
  display: grid;
  gap: 16px;
}

.guestbook-form {
  margin-bottom: 18px;
}

.guestbook-entry {
  display: grid;
  gap: 10px;
}

.guestbook-entry header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(62, 145, 211, .22);
}

.guestbook-entry p {
  margin: 0;
  line-height: 1.6;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(4, 27, 64, .74);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 72vh;
  border: 4px solid #fff;
  border-radius: 8px;
  box-shadow: 0 8px 0 var(--shadow-hard), 0 20px 48px rgba(0, 0, 0, .3);
}

.lightbox h2,
.lightbox p {
  width: min(100%, 1100px);
  margin: 10px 0 0;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

body.modal-open {
  overflow: hidden;
}

.item-rain-layer {
  position: fixed;
  inset: 0 0 auto;
  z-index: 3;
  height: 34vh;
  overflow: hidden;
  pointer-events: none;
}

.poporing-mascot {
  position: absolute;
  right: -18px;
  bottom: 58px;
  z-index: 4;
  width: clamp(92px, 11vw, 156px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 5px 0 rgba(0, 52, 112, .18)) drop-shadow(0 14px 22px rgba(0, 0, 0, .22));
}

.familiar-mascot,
.menu-familiar-mascot {
  z-index: 5;
  width: clamp(76px, 7vw, 108px);
  height: auto;
  pointer-events: none;
  transform: rotate(-8deg);
  filter: drop-shadow(0 4px 0 rgba(0, 52, 112, .16)) drop-shadow(0 14px 20px rgba(0, 0, 0, .2));
}

.familiar-mascot {
  position: fixed;
  left: calc(max(12px, (100vw - 1190px) / 2) - 46px);
  top: 66px;
}

.menu-familiar-mascot {
  position: absolute;
  left: -44px;
  top: -42px;
}

.discord-page {
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.discord-widget {
  width: 100%;
  display: block;
}

.discord-widget iframe {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 650px;
  border: 0;
  border-radius: 5px;
}

.item-rain-layer img {
  position: absolute;
  top: -32px;
  left: calc(var(--rain-left, 50) * 1%);
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: auto;
  opacity: .86;
  filter: drop-shadow(0 2px 2px rgba(0, 45, 95, .24));
  animation: item-rain-fall var(--rain-duration, 6s) linear forwards;
  animation-delay: var(--rain-delay, 0s);
}

.item-rain-layer img:nth-child(2n) {
  width: 20px;
  height: 20px;
  opacity: .74;
}

.item-rain-layer img:nth-child(3n) {
  width: 18px;
  height: 18px;
  animation-duration: 6.8s;
}

@keyframes item-rain-fall {
  0% {
    transform: translate3d(0, -34px, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(calc(var(--rain-drift, 0) * 1px), 38vh, 0) rotate(260deg);
    opacity: 0;
  }
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 27, 64, .62);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-box {
  width: min(420px, 100%);
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 0 var(--shadow-hard), 0 24px 58px rgba(0, 0, 0, .36);
}

.confirm-modal-box h2 {
  margin: 0 0 8px;
  color: #004f99;
}

.confirm-modal-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

body.is-admin .confirm-modal {
  background: rgba(10, 9, 8, .72);
}

body.is-admin .confirm-modal-box {
  border-color: #c45a12;
}

body.is-admin .confirm-modal-box h2 {
  color: #a43b0f;
}

.story {
  display: grid;
  grid-template-columns: 220px 1fr;
}

.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.panel.compact {
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha-box {
  display: grid;
  gap: 10px;
  border: 2px solid #f07a24;
  border-radius: 6px;
  padding: 12px;
  background: #fff5e8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.captcha-box strong {
  color: #9b3108;
  font-size: 1rem;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 2px solid #6cb1de;
  border-radius: 6px;
  padding: 11px 12px;
  background: #f7fdff;
  color: var(--ink);
  font: inherit;
}

input[type="file"] {
  min-height: 48px;
  padding: 5px 8px;
  background: #f7fdff;
  color: var(--muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin: 0 12px 0 0;
  border: 2px solid #fff;
  border-radius: 5px;
  padding: 7px 16px;
  background: linear-gradient(180deg, #ffd870, #ff8a35);
  color: #642b00;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--shadow-hard), 0 0 0 1px rgba(0, 69, 120, .16);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(180deg, #ffe69a, #ff9a42);
}

.form-row > input,
.form-row > select,
.form-row > label,
.field-wrap {
  flex: 1 1 240px;
}

.field-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
}

.field-caption {
  display: block;
  color: #9d3600;
  font-size: .88rem;
  line-height: 1.25;
}

.field-wrap > input,
.field-wrap > textarea,
.field-wrap > select {
  font-weight: 500;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-items-form input::selection,
.admin-items-form textarea::selection,
.admin-items-search input::selection {
  color: #ffffff;
  background: #c45a12;
}

.admin-items-form input:focus,
.admin-items-form textarea:focus,
.admin-items-form select:focus,
.admin-items-search input:focus {
  border-color: #c45a12;
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 90, 18, .18);
}

.admin-items-form input[type="radio"],
.admin-items-form input[type="checkbox"] {
  accent-color: #c45a12;
}

.admin-items-form select option:checked {
  color: #ffffff;
  background: #c45a12;
}

.rich-editor {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 2px solid #6cb1de;
  border-radius: 6px;
  background: #f7fdff;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid rgba(62, 145, 211, .32);
  background: #e6f6ff;
}

.rich-editor-toolbar button {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid #6cb1de;
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.rich-editor-surface {
  min-height: 220px;
  padding: 12px;
  line-height: 1.6;
  outline: none;
}

.rich-editor-surface h2,
.rich-editor-surface h3,
.legal-page h3 {
  margin: 12px 0 4px;
}

.rich-editor-surface p,
.rich-editor-surface ul,
.rich-editor-surface ol,
.rich-editor-surface blockquote {
  margin: 0 0 10px;
}

.date-input {
  color-scheme: light;
}

.date-input::-webkit-calendar-picker-indicator {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  padding: 4px;
  background-color: #ffd870;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--shadow-hard);
}

.searchbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-searchbar {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 0 var(--shadow-hard), 0 18px 35px var(--shadow-soft);
}

.filter-search-row,
.filter-lower-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.filter-search-input {
  min-height: 42px;
}

.filter-selects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.filter-selects label {
  min-width: 140px;
  gap: 4px;
}

.filter-selects span {
  color: #004f99;
  font-size: .86rem;
  font-weight: 900;
}

.filter-selects select {
  min-height: 42px;
  padding-block: 8px;
}

.filter-selects select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: end;
}

.filter-actions:empty {
  display: none;
}

.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.table-row span {
  display: grid;
  gap: 3px;
}

.forum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(62, 145, 211, .28);
  border-radius: 6px;
  background: rgba(255, 255, 255, .62);
}

.forum-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.forum-row small {
  overflow-wrap: anywhere;
}

.forum-board-list {
  gap: 14px;
}

.forum-category.child-category {
  margin-left: 24px;
}

.board-row b,
.forum-thread-row b {
  display: grid;
  min-width: 76px;
  text-align: right;
  color: var(--accent);
}

.board-row b small,
.forum-thread-row b small {
  color: var(--muted);
  font-size: 0.75rem;
}

.forum-thread-row em {
  color: #a22d00;
  font-style: normal;
}

.forum-moderation-actions .card-actions,
.forum-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.forum-moderation-actions {
  margin-bottom: 18px;
}

.forum-post-actions details {
  width: 100%;
}

.forum-attachments {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(62, 145, 211, 0.22);
}

.forum-attachments a {
  width: fit-content;
}

.bbcode-code {
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: #1f252b;
  color: #f7fdff;
}

.bbcode-image {
  max-width: 100%;
  border-radius: 6px;
}

.bbcode-spoiler {
  border: 1px solid rgba(240, 122, 36, 0.45);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff8ef;
}

.bbcode-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 -4px;
  padding: 8px;
  border: 1px solid #8ab8df;
  border-radius: 4px;
  background: linear-gradient(#d7eafd, #b8d8f3);
}

.bbcode-toolbar button {
  min-height: 30px;
  padding: 4px 9px;
  border-color: #ffffff;
  border-radius: 3px;
  font-size: .86rem;
  box-shadow: 0 2px 0 #7798b6;
}

/* Old-school forum skin: inspired by classic bulletin boards, but still using our layout. */
.forum-compose,
.forum-category,
.forum-thread-panel {
  margin-bottom: 18px;
  border: 1px solid #1b5da0;
  border-radius: 3px;
  background: #eef6fd;
  box-shadow: 0 2px 0 #8bb4d8;
  overflow: hidden;
}

.forum-compose h2,
.forum-category h2,
.forum-thread-panel h2 {
  margin: -24px -24px 14px;
  padding: 9px 13px;
  border-bottom: 1px solid #174d86;
  background: linear-gradient(#2b7bc2, #074f99);
  color: #fff;
  font-size: 1rem;
  text-shadow: 0 1px 0 #00325f;
}

.forum-compose {
  gap: 8px;
}

.forum-compose input,
.forum-compose select,
.forum-compose textarea {
  border-color: #7ea8cf;
  border-radius: 2px;
  background: #fbfdff;
}

.forum-board-list {
  grid-template-columns: 1fr;
  gap: 18px;
}

.forum-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.forum-category {
  padding-bottom: 0;
}

.forum-category > p {
  margin: 0 0 10px;
  color: #173f68;
}

.forum-category.child-category {
  margin-left: 0;
}

.forum-compose {
  margin-bottom: 18px;
}

.forum-category {
  overflow: hidden;
}

.forum-category-head,
.board-row,
.forum-thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 82px minmax(170px, .72fr);
  align-items: stretch;
  column-gap: 0;
}

.forum-category-head {
  margin: 0 -24px;
  border-top: 1px solid #9dc5e7;
  border-bottom: 1px solid #8ab8df;
  background: linear-gradient(#d7eafd, #b8d8f3);
  color: #104b82;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.forum-category-head span,
.forum-category-head b {
  padding: 7px 12px;
}

.forum-category-head b {
  border-left: 1px solid #8ab8df;
  text-align: center;
}

.forum-row.board-row,
.forum-thread-row {
  margin: 0 -24px;
  padding: 0;
  gap: 0;
  border: 0;
  border-bottom: 1px solid #bdd7ee;
  border-radius: 0;
  background: linear-gradient(90deg, #f8fcff, #e7f2fb);
}

.thread-list {
  gap: 18px;
  margin-bottom: 18px;
}

.thread-list + form.panel,
.thread-list + section.panel {
  margin-top: 18px;
}

.forum-thread-panel .forum-thread-row {
  grid-template-columns: minmax(0, 1fr) 86px minmax(160px, .45fr);
}

.forum-row.board-row:hover,
.forum-thread-row:hover {
  background: linear-gradient(90deg, #fff, #dcecf8);
}

.forum-row.board-row span,
.forum-thread-row span {
  padding: 12px 14px;
}

.forum-last-post {
  display: grid;
  align-content: center;
  gap: 4px;
  border-left: 1px solid #bdd7ee;
  color: #104b82;
  font-size: .88rem;
  line-height: 1.25;
}

.forum-last-post a {
  font-weight: 900;
}

.forum-last-post small {
  color: #315f86;
  font-size: .78rem;
}

.forum-row.board-row strong::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 1px solid #2e6fa8;
  border-radius: 2px;
  background: linear-gradient(#fff9b6, #f3a93b);
  vertical-align: -2px;
}

.forum-row.board-row b,
.forum-thread-row b {
  justify-content: center;
  min-width: 0;
  padding: 12px 8px;
  border-left: 1px solid #bdd7ee;
  color: #063f7a;
  text-align: center;
}

.forum-row.board-row b small,
.forum-thread-row b small {
  display: block;
  margin-top: 2px;
  color: #406b91;
}

.forum-thread-panel .empty-state,
.forum-thread-panel .forum-thread-row:last-child,
.forum-category .board-row:last-child {
  border-bottom: 0;
}

.event-registration-form {
  margin-top: 18px;
}

.event-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-status-actions .active {
  border-color: #073d94;
  background: linear-gradient(180deg, #087dd8, #004bb1);
  color: #ffffff;
  box-shadow: 0 4px 0 #00345f, 0 0 0 1px rgba(255, 255, 255, .75);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .28);
  pointer-events: none;
}

.event-participants {
  margin-top: 18px;
}

.event-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.event-status-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.event-status-column h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: #004f99;
}

.event-status-column h3 span {
  min-width: 32px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: .9rem;
  text-align: center;
}

.event-participant {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(62, 145, 211, .28);
  border-radius: 6px;
  background: rgba(255, 255, 255, .68);
}

.event-participant img,
.event-participant-empty {
  width: 42px;
  height: 42px;
}

.event-participant span:not(.avatar) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.event-participant strong,
.event-participant small {
  overflow-wrap: anywhere;
}

.post {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
}

.avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #e8f8ff, #8ccaf0);
  border: 2px solid #2384cc;
  border-radius: 8px;
  font-weight: 900;
}

.avatar {
  width: 54px;
  height: 54px;
}

.avatar img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.profile-head {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 180px;
  margin-top: 42px;
}

.profile-head + .panel,
.profile-head + form.panel,
.page-content > .panel + .panel,
.page-content > .panel + form.panel,
.page-content > form.panel + .panel,
.page-content > form.panel + form.panel {
  margin-top: 18px;
}

.profile-nav-panel {
  margin-top: 18px;
}

.admin-section-nav {
  width: 100%;
  max-width: none;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  aspect-ratio: 1;
  color: #004f99;
  font-size: 4rem;
}

.pill {
  border: 2px solid #2384cc;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #0068b9;
  font-weight: 900;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  justify-content: flex-start;
}

.profile-tabs a,
.profile-tabs span {
  min-height: 42px;
}

.profile-tabs .active {
  color: #ffffff;
  background: linear-gradient(180deg, #087dd8, #004bb1);
  border-color: #073d94;
  pointer-events: none;
}

.profile-panel-list {
  width: 100%;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.profile-public-facts,
.forum-author-facts {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
}

.profile-public-facts div,
.forum-author-facts div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
}

.profile-public-facts dt,
.forum-author-facts dt {
  color: #004f99;
  font-weight: 900;
}

.profile-public-facts dd,
.forum-author-facts dd {
  margin: 0;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--ink);
}

.inline-check input {
  width: auto;
}

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

.profile-gallery-edit {
  display: grid;
  gap: 8px;
}

.profile-gallery-edit textarea {
  min-height: 74px;
}

.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 2px solid #2384cc;
  border-radius: 5px;
  padding: 9px 12px;
  background: #f7fdff;
  color: var(--ink);
  font-weight: 800;
}

.account-danger {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(229, 77, 77, .35);
  padding-top: 14px;
}

.account-security,
.account-pending {
  display: grid;
  gap: 10px;
}

.account-danger h3,
.account-danger p,
.account-pending h3,
.account-pending p {
  margin: 0;
}

.message-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(62, 145, 211, .28);
}

.message-row span {
  display: grid;
  gap: 4px;
}

.message-row p {
  margin: 0;
}

.message-row form {
  margin: 0;
}

.avatar-cropper {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.avatar-cropper[hidden] {
  display: none;
}

.avatar-crop-stage {
  position: relative;
  width: min(100%, 320px);
  min-width: 280px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #2384cc;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .55) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 105, 190, .14) 25%, transparent 25%),
    #dff7ff;
  background-size: 28px 28px;
  cursor: grab;
}

.avatar-crop-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: inset 0 0 0 999px rgba(0, 63, 126, .08);
  pointer-events: none;
}

.avatar-crop-stage.is-dragging {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
}

.avatar-zoom {
  accent-color: #ff8a35;
}

.main-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 900;
}

.main-choice input {
  width: auto;
}

.map-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.map-list a {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 6px;
  font-weight: 900;
}

.map-list a.active {
  background: #fff;
  color: #0057a8;
}

.map-stage {
  overflow: hidden;
}

.map-canvas {
  position: relative;
  min-height: 560px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .26) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 105, 190, .12) 25%, transparent 25%),
    #a7d9f5;
  background-size: cover, 48px 48px, 48px 48px;
}

.marker {
  position: absolute;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 0;
  background: linear-gradient(180deg, #ffcf47, #f05b24);
  color: white;
  border: 4px solid white;
  box-shadow: 0 6px 0 var(--shadow-hard);
}

.map-info {
  padding: 18px;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-attention-grid {
  margin-top: 6px;
  margin-bottom: 0;
}

.admin-overview-groups {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.admin-overview-group .admin-dashboard {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.admin-welcome,
.admin-form {
  width: 100%;
  max-width: none;
}

.admin-section-nav + .admin-two-col,
.admin-section-nav + .panel {
  margin-top: 24px;
}

.admin-list {
  width: 100%;
  max-width: none;
  margin-top: 16px;
}

.admin-item-toolbar {
  width: 100%;
  max-width: none;
  margin-bottom: 16px;
}

.live-search {
  margin-bottom: 12px;
}

.is-filtered-out {
  display: none !important;
}

.thread-list {
  display: grid;
  gap: 16px;
}

.forum-post {
  grid-template-columns: 180px minmax(0, 1fr);
}

.post-author {
  display: grid;
  align-content: start;
  gap: 8px;
}

.post-author img,
.forum-avatar-empty {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 2px solid #2384cc;
  border-radius: 8px;
  background: linear-gradient(180deg, #e8f8ff, #8ccaf0);
}

.forum-avatar-empty {
  display: grid;
  place-items: center;
  color: #004f99;
  font-size: 2.4rem;
  font-weight: 900;
}

.post-author a {
  color: #005ca8;
}

.forum-author-facts {
  font-size: .9rem;
}

.forum-author-facts div {
  grid-template-columns: 88px 1fr;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
}

.pagination .button {
  min-width: 42px;
  text-align: center;
}

.pagination-gap {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 4px;
  color: var(--muted);
  font-weight: 900;
}

.pagination .button.active {
  color: #ffffff;
  background: linear-gradient(180deg, #087dd8, #004bb1);
  border-color: #073d94;
  box-shadow: 0 4px 0 #00345f, 0 0 0 1px rgba(255, 255, 255, .75);
  pointer-events: none;
}

.button.active,
button.active,
.filter-tabs .active,
.profile-tabs .active {
  color: #ffffff;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(62, 145, 211, .28);
}

.suggestion-row {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(62, 145, 211, .28);
}

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

.suggestion-compare textarea {
  min-height: 96px;
}

.admin-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-item-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  border: 1px solid rgba(196, 90, 18, .55);
  border-radius: 4px;
  background: #fff7ed;
}

.admin-item-icon.empty {
  border-style: dashed;
  background: rgba(196, 90, 18, .08);
}

.admin-row strong,
.admin-row small {
  overflow-wrap: anywhere;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row-actions form {
  margin: 0;
}

.admin-menu-editor {
  display: grid;
  gap: 12px;
}

.admin-menu-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .8fr) 110px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(196, 90, 18, .26);
  background: rgba(255, 248, 239, .62);
}

.admin-menu-row small {
  grid-column: 1 / -1;
}

.guild-members-panel {
  max-width: 920px;
}

.guild-member-list {
  display: grid;
  gap: 12px;
}

.guild-member-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(62, 145, 211, .28);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
}

.guild-member-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #2384cc;
  border-radius: 8px;
  background: linear-gradient(180deg, #e8f8ff, #8ccaf0);
  color: #004f99;
  font-size: 2rem;
  font-weight: 900;
  text-decoration: none;
  overflow: hidden;
}

.guild-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-member-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.guild-member-body h3,
.guild-member-body p {
  margin: 0;
}

.guild-member-body small {
  color: var(--muted);
  font-weight: 800;
}

.guild-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.request-row {
  align-items: flex-start;
}

.request-row.is-bug-report {
  border-left: 4px solid #e54d4d;
  padding-left: 12px;
  background: linear-gradient(90deg, rgba(229, 77, 77, .12), rgba(255, 248, 239, .7));
}

.request-row.is-bug-report strong {
  color: #b51f1f;
}

.button.danger,
button.danger {
  border-color: #fff;
  background: linear-gradient(180deg, #ff8f8f, #e54d4d);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px 12px;
  width: min(100%, 560px);
}

.check-list label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 800;
}

.check-list input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  justify-self: start;
  flex: none;
}

.permission-groups {
  display: grid;
  gap: 14px;
  width: min(100%, 760px);
}

.permission-group {
  border: 1px solid rgba(14, 91, 169, .2);
  border-radius: 6px;
  padding: 12px;
}

.permission-group legend {
  padding: 0 8px;
  color: var(--blue-dark);
  font-weight: 900;
}

.category-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #b6c9dd;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff, #dce8f4);
  color: #234d9d;
  font-weight: 900;
}

.empty-state {
  padding: 18px;
  text-align: center;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.empty-state.inline {
  text-align: left;
  background: rgba(255, 255, 255, .55);
  border-radius: 6px;
}

.category-choice input {
  width: auto;
}

.admin-role-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-permission-role-row {
  display: block;
  padding: 18px 0;
}

.admin-role-permissions-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.admin-role-permissions-form .permission-groups {
  grid-column: 2;
  width: 100%;
}

.admin-role-permissions-form .admin-row-actions {
  grid-column: 2;
  justify-content: flex-end;
}

.admin-delete-inline {
  display: none;
}

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

.admin-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-status-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 100, 34, .3);
  border-radius: 5px;
  background: #fff8ef;
  color: #4c2108;
  font-weight: 900;
}

.admin-status-list strong {
  color: #d94c16;
  font-size: 1.2rem;
}

.forum-role-matrix {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.forum-role-head,
.forum-role-row {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) repeat(4, minmax(44px, 58px));
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.forum-role-head {
  color: #9d3600;
  font-size: .76rem;
}

.forum-role-head b,
.forum-role-row input {
  justify-self: center;
}

.forum-role-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-footer {
  position: relative;
  width: min(1190px, 100% - 24px);
  margin: 54px auto 0;
  padding: 24px 0 36px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  border-top: 2px solid rgba(62, 145, 211, .35);
}

.footer-notice {
  max-width: 560px;
  line-height: 1.45;
}

.footer-links {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 900;
}

.footer-links a {
  color: #0068b9;
}

.info-page {
  max-width: 760px;
}

.legal-page {
  max-width: 920px;
}

.legal-page h2 {
  margin: 10px 0 0;
}

.legal-page p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

.legal-page ul,
.legal-page ol,
.legal-page blockquote {
  line-height: 1.65;
  color: var(--muted);
}

.rich-content {
  line-height: 1.65;
  color: var(--muted);
}

.legal-page a {
  color: #0068b9;
  font-weight: 900;
}

body.is-admin .site-footer {
  border-top-color: rgba(196, 90, 18, .44);
}

body.is-admin .footer-links a,
body.is-admin .legal-page a,
body.is-admin .section-head a {
  color: #d86422;
}

body.is-admin .panel h1,
body.is-admin .panel h2,
body.is-admin .card h3,
body.is-admin .story h2,
body.is-admin .detail-list dt,
body.is-admin .profile-public-facts dt,
body.is-admin .forum-author-facts dt,
body.is-admin .admin-row strong,
body.is-admin .table-row strong,
body.is-admin .linked-list a,
body.is-admin .card h3 a,
body.is-admin .detail-list a,
body.is-admin .post-author a {
  color: #a43b0f;
}

body.is-admin .button,
body.is-admin button,
body.is-admin input[type="file"]::file-selector-button,
body.is-admin .pagination .button.active,
body.is-admin .profile-tabs .active {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #f07a2a);
  color: #4c2108;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

body.is-admin .button.primary,
body.is-admin button.primary {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #e65b1c);
}

body.is-admin .pagination .button.active {
  border-color: #ffffff;
  background: linear-gradient(180deg, #168bd3, #005199);
  color: #ffffff;
  box-shadow: 0 4px 0 #00345f, 0 0 0 1px rgba(255, 255, 255, .75);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .28);
}

body.is-admin .button:hover,
body.is-admin button:hover,
body.is-admin input[type="file"]::file-selector-button:hover {
  background: linear-gradient(180deg, #ffe09a, #ff8f38);
}

body.is-admin .button.danger,
body.is-admin button.danger {
  border-color: #fff;
  background: linear-gradient(180deg, #ff8f8f, #e54d4d);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}

body.is-admin .download-badge,
body.is-admin .profile-avatar,
body.is-admin .avatar,
body.is-admin .post-author img,
body.is-admin .forum-avatar-empty,
body.is-admin .pill {
  border-color: #c45a12;
  background: linear-gradient(180deg, #fff8ef, #e4c2a4);
  color: #a43b0f;
}

body.is-admin .item-texture,
body.is-admin .item-art {
  border-color: rgba(196, 90, 18, .28);
}

body.is-admin input,
body.is-admin textarea,
body.is-admin select,
body.is-admin .rich-editor {
  border-color: #d86422;
  background: #fffaf3;
}

body.is-admin input:focus,
body.is-admin textarea:focus,
body.is-admin select:focus,
body.is-admin .rich-editor:focus-within {
  border-color: #168bd3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 139, 211, .24);
}

body.is-admin .rich-editor-toolbar {
  border-bottom-color: rgba(196, 90, 18, .34);
  background: #f3dcc6;
}

body.is-admin .rich-editor-toolbar button,
body.is-admin .category-choice label,
body.is-admin .check-list label {
  border-color: #d86422;
  background: linear-gradient(180deg, #fff8ef, #ead0b7);
  color: #4c2108;
}

body.is-admin .permission-group {
  border-color: rgba(216, 100, 34, .38);
  background: rgba(255, 248, 239, .58);
}

body.is-admin .permission-group legend {
  color: #a83d0b;
}

body.is-admin .admin-row,
body.is-admin .suggestion-row,
body.is-admin .detail-list div,
body.is-admin .forum-row,
body.is-admin .event-participant {
  border-color: rgba(196, 90, 18, .26);
}

body.is-profile-backend .site-footer {
  border-top-color: rgba(196, 90, 18, .44);
}

body.is-profile-backend .site-header {
  border-bottom-color: rgba(196, 90, 18, .42);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
}

body.is-profile-backend .brand {
  color: #4c2108;
}

body.is-profile-backend .nav a {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #f07a2a);
  color: #4c2108;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

body.is-profile-backend .footer-links a,
body.is-profile-backend .legal-page a,
body.is-profile-backend .section-head a,
body.is-profile-backend .panel h1,
body.is-profile-backend .panel h2,
body.is-profile-backend .detail-list dt,
body.is-profile-backend .profile-public-facts dt,
body.is-profile-backend .table-row strong,
body.is-profile-backend .detail-list a {
  color: #a43b0f;
}

body.is-profile-backend .quest-board.page-menu {
  border-color: #f05b24;
  background: #ffffff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .48), 0 18px 38px rgba(0, 0, 0, .36);
  overflow: visible;
}

body.is-profile-backend .quest-board.page-menu h2 {
  color: #fff8ef;
  background: linear-gradient(180deg, #d86422, #9b3710);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .46);
}

body.is-profile-backend .quest-board.page-menu a {
  border-color: #d86422;
  background: linear-gradient(180deg, #fff8ef, #ead0b7);
  color: #4c2108;
}

body.is-profile-backend .quest-board.page-menu a.active-menu {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #f07a2a);
  color: #4c2108;
}

body.is-profile-backend .panel,
body.is-profile-backend .profile-head,
body.is-profile-backend .table-row {
  border-color: #c45a12;
  background: #ffffff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .48), 0 18px 35px rgba(0, 0, 0, .34);
}

body.is-profile-backend .button,
body.is-profile-backend button,
body.is-profile-backend input[type="file"]::file-selector-button,
body.is-profile-backend .profile-tabs .active {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #f07a2a);
  color: #4c2108;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

body.is-profile-backend .button.primary,
body.is-profile-backend button.primary {
  border-color: #fff;
  background: linear-gradient(180deg, #ffd276, #e65b1c);
}

body.is-profile-backend .button:hover,
body.is-profile-backend button:hover,
body.is-profile-backend input[type="file"]::file-selector-button:hover {
  background: linear-gradient(180deg, #ffe09a, #ff8f38);
}

body.is-profile-backend .button.danger,
body.is-profile-backend button.danger {
  border-color: #fff;
  background: linear-gradient(180deg, #ff8f8f, #e54d4d);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}

body.is-profile-backend .profile-avatar,
body.is-profile-backend .avatar,
body.is-profile-backend .pill {
  border-color: #c45a12;
  background: linear-gradient(180deg, #fff8ef, #e4c2a4);
  color: #a43b0f;
}

body.is-profile-backend input,
body.is-profile-backend textarea,
body.is-profile-backend select {
  border-color: #d86422;
  background: #fffaf3;
}

body.is-profile-backend input:focus,
body.is-profile-backend textarea:focus,
body.is-profile-backend select:focus {
  border-color: #a43b0f;
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 90, 18, .2);
}

body.is-profile-backend .detail-list div,
body.is-profile-backend .table-row {
  border-color: rgba(196, 90, 18, .26);
}

@media (max-width: 980px) {
  body.has-page-hero main,
  .hero,
  .story,
  .profile-head,
  .entity-detail,
  .map-layout,
  .forum-post,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .page-content,
  .page-menu {
    grid-column: 1;
  }

  .page-menu {
    position: static;
    margin-top: 18px;
  }

  .quest-board.page-menu {
    max-height: none;
    overflow: hidden;
  }

  .hero {
    padding-top: 34px;
  }

  .quest-board {
    order: 2;
    width: min(100%, 360px);
  }

  .hero-badges {
    display: none;
  }

  .quick-grid,
  .card-grid,
  .database,
  .forum-directory,
  .gallery-grid,
  .admin-dashboard,
  .admin-two-col,
  .check-list,
  .category-choice,
  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .admin-overview-group .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .suggestion-compare {
    grid-template-columns: 1fr;
  }

  .event-status-grid {
    grid-template-columns: 1fr;
  }

  .profile-head {
    align-items: start;
  }

  .detail-list div {
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .poporing-mascot,
  .familiar-mascot,
  .menu-familiar-mascot {
    display: none;
  }

  main {
    width: min(100% - 16px, 1190px);
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand {
    max-width: 100%;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav a {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding-inline: 8px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 15vw, 4.1rem);
  }

  .searchbar {
    flex-direction: column;
  }

  .filter-search-row,
  .filter-lower-row,
  .filter-selects {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: flex-start;
  }

  .list-database .card > div {
    grid-template-columns: 1fr;
  }

  .list-database .card-actions {
    justify-content: flex-start;
  }

  .admin-row,
  .admin-menu-row,
  .admin-role-row,
  .guild-member-card,
  .table-row,
  .forum-row {
    align-items: stretch;
    flex-direction: column;
  }

  .guild-member-card {
    grid-template-columns: 1fr;
  }

  .admin-row-actions,
  .card-actions,
  .guild-member-actions,
  .share-row {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-row-actions .button,
  .admin-row-actions button,
  .card-actions .button,
  .guild-member-actions .button,
  .guild-member-actions button,
  .share-row .button,
  .share-row button {
    flex: 1 1 160px;
  }

  .admin-form,
  .admin-list,
  .panel,
  .compact {
    max-width: 100%;
  }

  .admin-menu-row {
    grid-template-columns: 1fr;
  }

  .admin-role-permissions-form {
    grid-template-columns: 1fr;
  }

  .admin-role-permissions-form .permission-groups,
  .admin-role-permissions-form .admin-row-actions {
    grid-column: 1;
  }

  input,
  select,
  textarea,
  button,
  .button {
    max-width: 100%;
  }

  .map-canvas {
    min-height: 360px;
  }

  .site-footer {
    align-items: flex-start;
  }
}
