/* Readable copy and homepage refinements. */
:root {
  --muted: #e5dced;
  --copy-secondary: #d8cbe2;
}

.layout { grid-template-columns: 185px minmax(0, 1fr) 224px; }
.home-intro { min-width: 0; }
.home-intro .welcome-bar > span { color: #ded2ed; font-size: 11px; white-space: normal; }
.hero-caption { flex-wrap: wrap; }
.hero-caption p,
.guide p,
.guide-grid p,
.demo-grid p,
.system p,
.journal p,
.original-ticker > p,
.dialog-copy p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: break-word;
}
.guide-grid > a {
  padding: 19px 38px 19px 18px;
  transition: border-color 240ms ease, box-shadow 240ms ease;
}
.guide-grid > a:is(:hover, :focus-visible) {
  border-color: #d7b476;
  box-shadow: inset 0 0 0 3px #0c0a1266, inset 0 0 0 160px #68427f30, 0 0 15px #9364b333;
}
.guide-grid > a strong,
.guide-grid > a > span { transition: color 240ms ease; }
.guide-grid > a:is(:hover, :focus-visible) strong,
.guide-grid > a:is(:hover, :focus-visible) > span { color: #ffe1a3; }
.guide-grid strong { font-size: 20px; line-height: 1.35; }
.guide-grid p { margin-top: 9px; }
.system h3,
.demo-grid h3 { font-size: 21px; line-height: 1.3; }
.system > div:last-child,
.demo-grid article > div { padding: 18px; }
.system p,
.demo-grid p { margin-top: 10px; }
.textlink,
.guide a,
.recover { font-size: 13px; line-height: 1.5; white-space: normal; }
.eyebrow,
.system .eyebrow,
.section-head .eyebrow,
.boosted-creature .eyebrow {
  font-size: 11px;
  line-height: 1.5;
  color: var(--copy-secondary);
  letter-spacing: 1px;
}
.mainnav .menu-links a { font-size: 11px; line-height: 1.35; }
.left .guide p,
.left .guide a { font-size: 12px; }
.button,
.start .button,
.home-cta .button,
.login-actions .button { font-size: 13px; }
.home-cta .button { min-height: 44px; padding: 8px; text-align: center; }
.login,
.quick-login-preview label,
.quick-login-preview > small,
.snapshot-note,
.empty-widget {
  font-size: 12px;
  line-height: 1.6;
  color: var(--copy-secondary);
}
.quick-login-preview input { font-size: 14px; padding: 10px; }
.quick-login-preview input::placeholder { color: #bba8cb; }
.login-actions .button { min-height: 39px; }
.login { font-size: 11px; }
.snapshot-note { font-size: 9px; }
.empty-widget { font-size: 11px; }
.restored-widget .widget-footer { font-size: 10px; line-height: 1.5; }
.right .restored-widget > h2 { font-size: 17px; min-height: 49px; }
.server-values > div { font-size: 11px; padding: 8px 0; }
.server-values dt { color: var(--copy-secondary); }
.connection-restored span { font-size: 11px; line-height: 1.5; color: var(--copy-secondary); }
.connection-restored strong,
.connection-restored a { font-size: 13px; line-height: 1.5; }
.connection-restored > div { padding: 12px 9px; }
.quicklinks span { font-size: 14px; line-height: 1.45; }
.quicklinks small { font-size: 12px; line-height: 1.5; color: var(--copy-secondary); }
.quicklinks > a { min-width: 0; }
.quicklinks span { min-width: 0; }
.welcome-restored-head h2 { font-size: 26px; }
.world-tag { font-size: 10px; }
.welcome-people span { font-size: 11px; line-height: 1.5; color: var(--copy-secondary); }
.welcome-people strong { font-size: 17px; line-height: 1.4; }
.welcome-people small { font-size: 12px; line-height: 1.5; color: var(--copy-secondary); }
.server-message { font-size: 13px; line-height: 1.65; color: var(--muted); }
.server-message b { font-size: 11px; color: var(--copy-secondary); }
.welcome-stats > div { padding: 12px 6px; }
.welcome-stats dt { font-size: 12px; line-height: 1.45; color: var(--copy-secondary); }
.welcome-stats dd { font-size: 23px; }
.original-ticker { flex-wrap: wrap; gap: 7px 15px; }
.original-ticker > strong { font-size: 14px; }
.original-ticker time { font-size: 12px; color: var(--copy-secondary); }
.collection-toolbar { flex-wrap: wrap; align-items: center; }
.collection-toolbar > span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--copy-secondary);
  max-width: none;
  flex: 1 1 170px;
}
.tabs button { font-size: 13px; min-height: 39px; padding: 9px 16px; }
.visual-card span {
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
  overflow-wrap: anywhere;
  color: #e1d2eb;
}
.visual-card .zoom { color: #ccb6dd; }
.collection-footer { flex-wrap: wrap; gap: 10px 18px; }
.collection-footer > span { font-size: 13px; line-height: 1.6; color: var(--copy-secondary); }
.collection-group + .collection-group { border-top: 1px solid #78557f; }
.collection-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 23px 0;
}
.collection-group-heading h3 { margin: 0; color: #f1cf91; font: 22px/1.3 var(--serif); }
.collection-count { flex-shrink: 0; padding: 5px 9px; border: 1px solid #795b86; border-radius: 14px; color: #e4d8ec; font-size: 11px; }
/* Fewer cards per row, with incomplete rows centered below the full rows. */
#outfits-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
#outfits-gallery .visual-card { flex: 0 1 104px; padding: 6px 4px 8px; }
#outfits-gallery .visual-card img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 4px; }
#outfits-gallery .visual-card span { font-size: 11px; line-height: 1.3; min-height: 2.6em; }
#outfits-gallery .visual-card .zoom { min-height: 0; right: 5px; top: 4px; }
#mounts-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#mounts-gallery > .visual-card { flex: 0 1 calc((100% - 30px) / 4); }
.demo-grid .demo-open > span { font-size: 12px; line-height: 1.5; padding: 11px 8px; }
.dialog-copy small { font-size: 12px; line-height: 1.6; color: var(--copy-secondary); }
.news-heading span { font-size: 12px; color: var(--copy-secondary); }
.right .boosted-creature .eyebrow { font-size: 8px; }
.boosted-creature > small { font-size: 10px; color: var(--copy-secondary); }
.castle-owner > div > a { font-size: 11px; line-height: 1.5; }
.castle-vacant small { font-size: 10px; line-height: 1.5; }
.castle-vacant small { color: var(--copy-secondary); }
.castle-owner > div > span,
.castle-vacant span { font-size: 15px; }
.cast-count { font-size: 12px; }
.proposal { font-size: 11px; flex-wrap: wrap; }
.preview-data-note,
footer small,
footer p { font-size: 12px; line-height: 1.6; color: var(--copy-secondary); }
.welcome-bar,
.welcome-bar > span:last-child { font-size: 11px; line-height: 1.5; }
.header-note > span,
.opening > span { font-size: 11px; line-height: 1.5; }
.opening small { font-size: 13px; line-height: 1.5; }

/* A middle size keeps the ranking portraits and names readable without tall rows. */
.ranking-list li > a { gap: 8px; min-height: 88px; }
.ranking-list img { width: 68px; height: 68px; object-fit: contain; }
.ranking-list strong {
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.ranking-list li > a > div > span { font-size: 11px; line-height: 1.4; }
.ranking-list small { font-size: 10px; line-height: 1.4; color: var(--copy-secondary); }
.boosted-creature > img { width: 116px; height: 116px; object-fit: contain; }
.right [data-widget="Monster Boost"] > h2 img,
.right [data-widget="Top Mounts"] > h2 img,
.right [data-widget="Top Outfits"] > h2 img,
.right [data-widget="Top Donates"] > h2 img,
.right [data-widget="Castelos"] > h2 img { width: 35px; height: 35px; object-fit: contain; }
.castle-owner > a { flex-shrink: 0; }
.castle-owner img { width: 54px; height: 54px; object-fit: contain; }
.castle-owner > div,
.castle-vacant > div { min-width: 0; overflow-wrap: anywhere; }
.castle-vacant b { flex: 0 0 54px; width: 54px; font-size: 30px; }

/* Carousel controls sit above the transient strip overlay. */
.slides { overflow: hidden; isolation: isolate; }
.slides > .arrow,
.slides > .dots { z-index: 5; }
.slides > .arrow { width: 34px; height: 46px; }
.slides > .dots button { width: 11px; height: 11px; }

/* Fixed-size image pieces are animated with the reference's exact swing curve. */
.carousel-transition {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.carousel-piece {
  position: absolute;
  background-repeat: no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .carousel-transition { display: none; }
}

@media (max-width: 1150px) {
  .layout { grid-template-columns: 165px minmax(0, 1fr) 205px; }
  .hero-caption > .textlink { white-space: normal; }
  .system-grid { grid-template-columns: 1fr; }
  .system { display: grid; grid-template-columns: 105px minmax(0, 1fr); align-items: stretch; }
  .system-art { height: 100%; min-height: 155px; border-bottom: 0; border-right: 1px solid #58405e; }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .layout { grid-template-columns: 155px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .collection-group-heading { padding: 18px 16px 0; align-items: flex-start; }
  .collection-group-heading h3 { font-size: 20px; }
  .collection-count { padding: 4px 7px; }
  .preview-data-note { font-size: 11px; }
  .welcome-bar { flex-wrap: wrap; }
  .hero-caption p,
  .guide-grid p,
  .demo-grid p,
  .system p { font-size: 13px; }
  .collection-toolbar > span { text-align: left; }
  .welcome-restored-head { flex-wrap: wrap; }
  .welcome-people { grid-template-columns: 1fr; }
  .guide-grid strong { font-size: 19px; }
  .home-cta .button { font-size: 12px; }
  .right .restored-widget > h2 { font-size: 15px; min-height: 45px; }
  .castle-owner > div > span,
  .castle-vacant span { font-size: 14px; }
  .right .boosted-creature .eyebrow { font-size: 7px; }
    .header-note > span,
  .opening > span { font-size: 10px; letter-spacing: .4px; }
  .opening small { font-size: 11px; }
}
@media (max-width: 560px) {
  #mounts-gallery > .visual-card { flex-basis: calc((100% - 10px) / 2); }
  .right.original-widgets { grid-template-columns: 1fr; }
  .guide-grid,
  .quicklinks { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .demo-grid > article { grid-template-columns: 1fr; }
  .demo-grid .demo-open img { max-height: 290px; }
  dialog[open] { grid-template-columns: 1fr; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .dialog-art { text-align: center; padding: 25px 15px 0; }
  .dialog-copy { padding: 15px 24px 24px; }
}

/* The sidebars share the banner's row, regardless of the ticker's height. */
@media (min-width: 761px) {
  .layout { row-gap: 0; }
  .layout > .home-intro { grid-column: 2; grid-row: 1; }
  .layout > .left { grid-column: 1; grid-row: 2; padding-top: 0; }
  .layout > main { grid-column: 2; grid-row: 2; }
  .layout > .right.original-widgets { grid-column: 3; grid-row: 2; padding-top: 0; }
  .start { position: relative; }
  .start > span { position: absolute; bottom: 100%; left: 0; right: 0; margin: 0 0 12px; }
  .start > .button:first-of-type { margin-top: 0; }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .layout > .left { grid-row: 2 / span 2; }
  .layout > .right.original-widgets { grid-column: 2; grid-row: 3; margin-top: 18px; }
}
@media (max-width: 760px) {
  .layout { row-gap: 0; }
  .layout > .left { margin-bottom: 14px; }
  .layout > .home-intro { width: 100%; }
  .layout > .right.original-widgets { margin-top: 18px; }
}

/* Sidebar sections expand and collapse without clipping their final contents. */
.menu-group.is-animating { box-sizing: border-box; overflow: hidden; }
.menu-group > summary b { transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.menu-group.is-closing > summary b { transform: rotate(0deg); }
.menu-group.is-animating > summary:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .menu-group > summary b { transition: none; }
}

/* A dismissible community invitation, separate from the visual galleries. */
html.discord-welcome-open { overflow: hidden; }
#discord-welcome {
  width: min(520px, calc(100% - 28px));
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #806348;
  border-top: 3px solid #dfbb71;
  border-radius: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #f4eaf7;
  background: linear-gradient(135deg, #24182f, #120f1c 75%);
  box-shadow: 0 24px 100px #000b, 0 0 45px #9870531f;
}
#discord-welcome[open] { display: block; animation: discord-arrive 280ms ease-out; }
#discord-welcome::backdrop { background: #08060ed4; backdrop-filter: blur(5px); animation: discord-backdrop 220ms ease-out; }
.discord-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid #c6a1db66;
  border-radius: 50%;
  background: #170f22dd;
  color: #e5d9ec;
  font: 24px/1 Arial, sans-serif;
  transition: background 180ms ease, color 180ms ease;
}
.discord-close:hover { background: #51335d; color: #fff; }
.discord-cover {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 188px;
  padding: 32px 40px 3px;
  border-bottom: 1px solid #85644566;
  background: linear-gradient(0deg, #21162dee, #170e2322 70%), url('/images/serverinfo/home-optimized/background-v1.webp') center 25% / cover;
}
.discord-cover > img { width: 280px; height: 155px; object-fit: contain; filter: drop-shadow(0 5px 15px #000a); }
.discord-welcome-label { position: absolute; left: 20px; top: 17px; color: #f6dca0; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-shadow: 0 2px 5px #000; }
.discord-body { padding: 24px 28px 22px; }
.discord-body h2 { margin: 0; font: 28px/1.25 var(--serif); color: #f3d28f; }
.discord-body h2 > span { color: #fff1d9; }
#discord-intro { margin: 12px 0 21px; color: #dacde5; font-size: 14px; line-height: 1.6; }
.discord-benefits { list-style: none; margin: 0 0 23px; padding: 0; display: grid; gap: 17px; }
.discord-benefits li { display: flex; align-items: center; gap: 13px; }
.discord-benefit-icon { flex: 0 0 35px; display: grid; place-items: center; height: 35px; border: 1px solid #9d77b550; border-radius: 8px; background: #76519426; color: #e7c48d; font-size: 20px; }
.discord-benefits strong { display: block; color: #f3e9f7; font-size: 14px; line-height: 1.4; }
.discord-benefits li > div > span { display: block; color: #cbbbd7; font-size: 12px; line-height: 1.5; margin-top: 3px; }
.discord-actions { display: flex; gap: 10px; padding-top: 21px; border-top: 1px solid #84604655; }
#discord-join,
.discord-actions > button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 16px; border-radius: 5px; font-size: 14px; font-weight: 700; transition: background 180ms ease, border-color 180ms ease; }
#discord-join { flex: 1; border: 1px solid #8c91ff; background: #5865f2; color: white; box-shadow: 0 3px 12px #414ab52e; }
#discord-join:hover { background: #4752c4; border-color: #b0b4ff; }
#discord-join svg { flex-shrink: 0; }
.discord-actions > button { border: 1px solid #8c718f; background: #21182b; color: #e4d6ec; }
.discord-actions > button:hover { background: #3c2a4a; border-color: #c39cce; }
.discord-optional { margin: 12px 0 0; color: #bfaecc; font-size: 11px; line-height: 1.5; }
.discord-reopen { display: block; margin: 14px auto 20px; padding: 9px 15px; border: 1px solid #79608e; border-radius: 4px; background: #2b1e3a; color: #ecdcf4; font-size: 12px; }
.discord-reopen:hover { background: #49315c; border-color: #c19ad6; }
@keyframes discord-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes discord-backdrop { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 560px) {
  .discord-cover { height: 164px; padding-inline: 30px; }
  .discord-cover > img { width: 235px; height: 130px; }
  .discord-welcome-label { font-size: 9px; letter-spacing: 1px; left: 17px; }
  .discord-body { padding: 21px 20px; }
  .discord-body h2 { font-size: 25px; }
  #discord-intro { font-size: 13px; }
}
@media (max-width: 380px) {
  .discord-actions { flex-direction: column; }
  .discord-benefits li { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #discord-welcome[open], #discord-welcome::backdrop { animation: none; }
}

/* Both registered outfit variants are visible together; mounts use one image. */
#visual-dialog { width: min(690px, calc(100% - 28px)); max-width: 690px; padding: 0; }
#visual-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 240px); gap: 8px; }
#visual-dialog .dialog-art { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 28px 18px; }
#visual-dialog .dialog-art figure { flex: 0 1 132px; margin: 0; min-width: 0; text-align: center; }
#visual-dialog .dialog-art figure[hidden],
#visual-dialog figcaption[hidden] { display: none; }
#visual-dialog .dialog-art img { display: block; width: 100%; height: 152px; object-fit: contain; }
#visual-dialog figcaption { margin-top: 12px; color: #f0d09b; font-size: 13px; line-height: 1.4; }
#visual-dialog .dialog-copy { padding: 36px 25px 30px 0; }
#visual-dialog .dialog-copy h2 { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  #visual-dialog[open] { grid-template-columns: 1fr; gap: 0; }
  #visual-dialog .dialog-art { padding: 35px 22px 12px; gap: 22px; }
  #visual-dialog .dialog-copy { padding: 10px 24px 24px; text-align: center; }
  #visual-dialog .dialog-copy h2 { margin-right: 0; }
}

/* Original fixed scenery restored across the entire scrolling page. */
body { background: #05070d; isolation: isolate; }
body::before {
  position: fixed;
  inset: 0;
  height: auto;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  background-image:
    linear-gradient(180deg, rgba(2,5,13,.08) 0, rgba(2,5,13,.20) 48%, rgba(5,7,13,.76) 100%),
    url('/plugins/theme-old-school/themes/old-school/images/detona-8k-bg.png');
  background-repeat: no-repeat, no-repeat;
  background-position: center top, center top;
  background-size: 100% 100%, cover;
}
.original-ticker { padding: 7px 13px; margin-bottom: 12px; gap: 13px; }
.original-ticker > p { margin: 0; font-size: 12px; line-height: 1.5; }
.system-art.wheel img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; filter: none; padding: 5px; }
.system-art.wheel { background: #262427; }
@media (min-width: 761px) {
  .original-ticker { display: flex; }
  .system-art { height: 180px; }
}
@media (max-width: 768px) {
  body::before {
    background-image:
      linear-gradient(180deg, rgba(2,5,13,.14) 0, rgba(2,5,13,.28) 54%, rgba(5,7,13,.82) 100%),
      url('/plugins/theme-old-school/themes/old-school/images/detona-8k-bg.png');
    background-position: center top, 32% top;
  }
}
@media (max-width: 768px) and (orientation: landscape) {
  body::before { background-position: center top, center top; }
}

/* Direct Wiki navigation shares menu styling without accordion event handlers. */
.mainnav > .menu-direct-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid #71537c;
  border-top-color: #ac8060;
  background: linear-gradient(#352447, #181425);
  box-shadow: inset 0 0 0 3px #16101e77, 0 4px 10px #0003;
  color: #edcf98;
  font: 15px var(--serif);
  text-decoration: none;
}
.mainnav > .menu-direct-link > img { width: 28px; height: 28px; image-rendering: pixelated; flex-shrink: 0; }
.mainnav > .menu-direct-link > span { width: auto; font: inherit; color: inherit; text-align: left; }
.mainnav > .menu-direct-link > b { margin-left: auto; font: 20px Arial, sans-serif; color: #a9d9ea; }
.mainnav > .menu-direct-link:is(:hover, :focus-visible) { background: linear-gradient(#49305e, #251c34); color: #edcf98; }
.mainnav > .menu-direct-link:focus-visible { outline: 2px solid #bcefff; outline-offset: 3px; }
