/* DreamScape website. Laid out like the 2011 RuneScape site (banner, menu bar,
   breadcrumbs, news column and sidebar) and dressed in the game's own login
   screen look: a moonlit purple night, carved stone frames and the gold logo.
   All art is DreamScape's own: the login screen images and CSS drawings. */
:root {
  --night: #120c1f;
  --night-2: #1d1433;
  --dusk: #3a2556;
  --mauve: #8b5a8f;
  --moon: #f3e8bf;
  --gold: #f2c75c;
  --gold-hi: #ffe7a0;
  --gold-lo: #a8741c;
  --stone: #3a3732;
  --stone-hi: #6d685e;
  --stone-lo: #1f1d1a;
  --panel: rgba(22, 17, 30, .92);
  --row: rgba(255, 255, 255, .035);
  --line: rgba(160, 140, 200, .18);
  --text: #ece4f2;
  --muted: #a99bbd;
  --green: #8fd36a;
  --red: #ef7b6b;
  --serif: "Cinzel", "Trajan Pro", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  color: var(--text);
  font: 13px/1.55 Verdana, Tahoma, "Segoe UI", sans-serif;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; }
code { font-size: 12px; background: rgba(0, 0, 0, .35); padding: 1px 5px; border-radius: 3px; color: var(--moon); }

/* ---- The night sky behind everything ---- */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 34%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 77% 58%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 26%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 84%, #fff5 50%, transparent 51%),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(150, 110, 200, .28), transparent 70%),
    radial-gradient(ellipse 70% 50% at 10% 100%, rgba(140, 70, 120, .25), transparent 70%),
    linear-gradient(180deg, #0d0918 0%, #1a1130 45%, #2a1a3e 80%, #352048 100%);
  background-size: 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, 420px 420px, auto, auto, auto;
}

#page { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* ---- Top strip ---- */
.topbar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 4px; font-size: 11px; color: var(--muted);
}
.topbar-status { display: inline-flex; align-items: center; gap: 6px; color: var(--moon); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #777; }
.dot.up { background: #6fe06a; box-shadow: 0 0 6px #6fe06a; }
.dot.down { background: #e0575a; box-shadow: 0 0 6px #e0575a; }

/* ---- Banner: the login screen's moonlit castle ---- */
.banner {
  position: relative; overflow: hidden;
  height: 210px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 34px;
  background: url("/art/background.png") 50% 62% / cover no-repeat, var(--dusk);
  border: 3px solid var(--stone-hi);
  outline: 2px solid var(--stone-lo); outline-offset: -5px;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 0 40px rgba(150, 100, 210, .25), 0 10px 24px rgba(0, 0, 0, .6);
}
.banner::after { /* Soft mist along the bottom edge. */
  content: ""; position: absolute; inset: auto 0 0 0; height: 60px;
  background: linear-gradient(transparent, rgba(18, 12, 31, .7));
  pointer-events: none;
}
.logo { position: relative; z-index: 1; }
.logo img { display: block; width: 278px; max-width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.logo:hover { text-decoration: none; }

.play-now {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 30px 10px;
  color: #2c1d02; text-decoration: none !important;
  background: linear-gradient(#fff2a6 0%, #f2cf4a 40%, #c9971f 60%, #f0c24a 100%);
  border: 2px solid #4a3006;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 #fff8d0, 0 0 0 2px rgba(255, 220, 120, .25), 0 0 26px rgba(255, 200, 90, .45), 0 6px 14px rgba(0, 0, 0, .6);
  transition: transform .15s, box-shadow .15s;
}
.play-now span { font: 900 26px/1 var(--serif); letter-spacing: .5px; text-shadow: 0 1px 0 #fff3b8; }
.play-now small { font-size: 11px; font-weight: bold; color: #5a3d06; margin-top: 3px; }
.play-now:hover { transform: translateY(-1px); color: #2c1d02; box-shadow: inset 0 1px 0 #fff8d0, 0 0 0 2px rgba(255, 220, 120, .4), 0 0 36px rgba(255, 210, 110, .7), 0 8px 16px rgba(0, 0, 0, .6); }

/* Fireflies drifting over the banner, as on the login screen. */
.fireflies i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 6px 2px rgba(255, 220, 140, .7);
  opacity: 0; animation: drift 9s ease-in-out infinite;
}
.fireflies i:nth-child(1) { left: 8%; top: 70%; animation-delay: 0s; }
.fireflies i:nth-child(2) { left: 22%; top: 82%; animation-delay: 1.4s; }
.fireflies i:nth-child(3) { left: 35%; top: 60%; animation-delay: 3s; }
.fireflies i:nth-child(4) { left: 48%; top: 78%; animation-delay: 4.2s; }
.fireflies i:nth-child(5) { left: 58%; top: 66%; animation-delay: 2.1s; }
.fireflies i:nth-child(6) { left: 66%; top: 85%; animation-delay: 5.5s; }
.fireflies i:nth-child(7) { left: 74%; top: 58%; animation-delay: .8s; }
.fireflies i:nth-child(8) { left: 83%; top: 76%; animation-delay: 6.3s; }
.fireflies i:nth-child(9) { left: 91%; top: 64%; animation-delay: 3.7s; }
.fireflies i:nth-child(10) { left: 14%; top: 50%; animation-delay: 7.1s; }
@keyframes drift {
  0% { opacity: 0; transform: translate(0, 0); }
  25% { opacity: .9; }
  60% { opacity: .5; }
  100% { opacity: 0; transform: translate(18px, -40px); }
}
@media (prefers-reduced-motion: reduce) {
  .fireflies i { animation: none; opacity: .6; }
}

/* ---- Menu bar: carved stone ---- */
.menu {
  display: flex; flex-wrap: wrap;
  background: linear-gradient(#57534a, #3d3a34 45%, #2e2b27 55%, #3a3731);
  border: 3px solid var(--stone-hi); border-top: 0;
  box-shadow: inset 0 1px 0 #8a8578, inset 0 -2px 0 #1a1816, 0 8px 18px rgba(0, 0, 0, .5);
}
.menu a {
  flex: 1 1 auto; text-align: center;
  padding: 10px 14px;
  font: 700 15px var(--serif); color: var(--gold);
  text-shadow: 0 2px 2px #000;
  border-right: 1px solid #22201c; box-shadow: 1px 0 0 #5c584f;
}
.menu a:last-child { border-right: 0; box-shadow: none; }
.menu a:hover { background: rgba(255, 230, 160, .07); color: var(--gold-hi); text-decoration: none; }
.menu a.active {
  color: #fff3c6;
  background: linear-gradient(#2c2340, #21192f);
  box-shadow: inset 0 2px 6px #000, inset 0 -2px 0 var(--gold);
}

/* ---- Double XP weekend strip, under the menu ---- */
.dxp {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px;
  margin-top: 10px; padding: 8px 14px; text-align: center;
  border: 1px solid var(--gold-lo); border-radius: 3px;
  background: rgba(242, 199, 92, .08); color: var(--text);
}
.dxp b { font: 700 15px var(--serif); color: var(--gold); text-shadow: 0 2px 2px #000; }
.dxp .dxp-time { color: var(--muted); font-size: 12px; }
.dxp.live { background: linear-gradient(90deg, rgba(168, 116, 28, .35), rgba(242, 199, 92, .22), rgba(168, 116, 28, .35)); border-color: var(--gold); }
.dxp.live b { color: var(--gold-hi); }
.dxp.live .dxp-time { color: var(--moon); }

.crumbs {
  margin: 10px 2px 12px; font-size: 11px; color: var(--muted);
}
.crumbs span { margin: 0 4px; color: var(--stone-hi); }
.crumbs b { color: var(--text); font-weight: normal; }

/* ---- Two columns, like the old site ---- */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
main { min-width: 0; }

/* ---- Stone panels, like the login box ---- */
.panel, .box {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--stone-hi);
  outline: 2px solid var(--stone-lo); outline-offset: -5px;
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(120, 80, 180, .18), 0 8px 18px rgba(0, 0, 0, .55);
  margin-bottom: 16px;
}
/* Riveted corners. */
.panel::before, .panel::after, .box::before, .box::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #b9b2a2 0 2px, #4b473f 2.5px 4px, transparent 4.5px);
}
.panel::before, .box::before { top: -3px; left: -3px; }
.panel::after, .box::after { top: -3px; right: -3px; }
.panel-head {
  padding: 9px 16px 8px;
  background: linear-gradient(#4f4b43, #34312c);
  border-bottom: 2px solid var(--stone-lo);
  box-shadow: inset 0 1px 0 #7d786c, 0 1px 0 #5a564d;
}
.panel-head h1 {
  margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font: 700 18px var(--serif); color: var(--gold);
  text-shadow: 0 2px 2px #000, 0 0 12px rgba(242, 199, 92, .25);
}
.panel-head .sub { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--moon); }
.panel-body { padding: 16px; }
.lead .panel-body { padding-bottom: 4px; }
.intro { margin: 0 0 12px; color: var(--muted); }
.muted { color: var(--muted); }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 3px; }
.notice { padding: 12px 14px; border: 1px solid var(--gold-lo); background: rgba(242, 199, 92, .08); border-radius: 3px; }
.panel-body h2 { font: 700 16px var(--serif); color: var(--gold); margin: 20px 0 8px; }
.panel-body h2:first-child { margin-top: 0; }

/* ---- Buttons ---- */
.gold-btn, .stone-btn {
  display: inline-block; cursor: pointer;
  padding: 7px 18px; border-radius: 3px;
  font: 700 14px var(--serif); text-decoration: none !important;
}
.gold-btn {
  color: #2c2003;
  background: linear-gradient(#f6e46a, #d8bd2c 50%, #a8901a 51%, #c9ad27);
  border: 1px solid #3a2e05;
  box-shadow: inset 0 1px 0 #fff6b0, 0 2px 4px rgba(0, 0, 0, .5);
}
.gold-btn:hover { color: #2c2003; filter: brightness(1.08); }
.gold-btn.big { display: block; text-align: center; font-size: 18px; padding: 10px; }
.stone-btn {
  color: var(--moon);
  background: linear-gradient(#5d594f, #3b3832);
  border: 1px solid #1a1816;
  box-shadow: inset 0 1px 0 #8a8578, 0 2px 4px rgba(0, 0, 0, .5);
}
.stone-btn:hover { color: #fff; filter: brightness(1.1); }

/* ---- Home ---- */
.welcome {
  position: relative; margin-bottom: 16px; padding: 22px 24px;
  border-radius: 4px; overflow: hidden;
  background: linear-gradient(90deg, rgba(18, 12, 31, .95) 35%, rgba(18, 12, 31, .3)), url("/art/loading.png") 100% 55% / 70% auto no-repeat, var(--night-2);
  border: 1px solid var(--line);
  box-shadow: 0 0 30px rgba(140, 90, 200, .2);
}
.welcome h1 { margin: 0 0 6px; font: 700 22px var(--serif); color: var(--gold); text-shadow: 0 2px 3px #000; }
.welcome p { max-width: 430px; margin: 0 0 14px; }

/* ---- News ----
   Everything on the news pages is drawn from updates.json by app.js: a post per day, a card per section,
   and 16:9 screenshot tiles that open in the viewer. Posts never need their own styling. */
.news-panel .panel-body { padding: 16px; }
.news-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; letter-spacing: .3px; color: var(--moon);
  background: rgba(139, 90, 143, .28); border: 1px solid rgba(139, 90, 143, .55);
}
.news-new { display: inline-block; margin-bottom: 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-hi); }
.date-badge {
  flex: 0 0 auto; width: 52px; padding: 5px 0 6px; text-align: center;
  border: 2px solid var(--gold-lo); border-radius: 4px; background: rgba(18, 12, 31, .85);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--moon);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.date-badge b { display: block; font: 900 22px/1.1 var(--serif); color: var(--gold); }
/* Long day titles stop at two lines on the home page; the post page shows them whole. */
.news-text h2, .feature-caption h2 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* Pictures: a screenshot cropped to fill, or the night scene with the category's mark. */
.news-thumb, .tile-shot, .feature-shot, .hero-shot {
  position: relative; background: var(--dusk) center / cover no-repeat;
}
.news-thumb span, .tile-shot span, .feature-shot span, .hero-shot span { display: none; }
.feature-shot.no-shot, .hero-shot.no-shot { background-size: cover !important; background-position: 50% 60% !important; }
.no-shot span {
  display: block; position: absolute; right: 6px; bottom: 4px;
  font-size: 18px; color: var(--gold); text-shadow: 0 0 6px #000, 0 0 2px #000;
}

/* The newest day, big at the top of the home page. */
.news-feature { margin-bottom: 6px; }
.feature-art {
  display: block; position: relative; overflow: hidden; border-radius: 3px;
  border: 2px solid var(--stone-hi); outline: 1px solid var(--stone-lo);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .55);
}
.feature-art:hover { text-decoration: none; }
.feature-shot { aspect-ratio: 16 / 7; transition: transform .4s ease; }
.feature-art:hover .feature-shot { transform: scale(1.02); }
.feature-caption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 14px;
  padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(12, 8, 22, .82) 45%, rgba(12, 8, 22, .96));
}
.feature-caption h2 { margin: 0; font: 700 19px/1.3 var(--serif); color: var(--gold); text-shadow: 0 2px 3px #000; }
.feature-caption p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.feature-summary { margin: 12px 0 6px; }
.news-feature > .read-more { display: inline-block; margin-top: 10px; }

/* Picture tiles linking to each section of a day. */
.news-tiles {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.news-tiles a {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 3px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.news-tiles a:hover { text-decoration: none; border-color: var(--gold-lo); background: rgba(242, 199, 92, .07); transform: translateY(-1px); }
.news-tiles a:hover span { color: var(--gold-hi); }
.tile-shot { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--stone-lo); }
.news-feature .news-tiles { grid-template-columns: repeat(4, 1fr); }
.news-tiles span:not(.tile-shot span) { padding: 7px 9px 8px; font-size: 12.5px; line-height: 1.35; }
.news-tiles .more a { justify-content: center; align-items: center; text-align: center; min-height: 110px; color: var(--gold); }
.news-tiles .more b { font: 900 26px var(--serif); }
.news-tiles .more span { padding-top: 0; color: var(--muted); }

/* Earlier days: a row each. */
.news-older {
  margin: 22px 0 0 !important; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font: 700 14px var(--serif) !important; letter-spacing: .5px; color: var(--moon) !important;
}
.news-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.news-item .news-thumb {
  flex: 0 0 auto; width: 150px; aspect-ratio: 16 / 9; border-radius: 3px;
  border: 2px solid var(--stone-hi); outline: 1px solid var(--stone-lo);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
}
.news-text { min-width: 0; }
.news-text h2 { margin: 0; font: 700 15px/1.35 var(--serif); }
.news-text h2 a { color: var(--gold); }
.news-meta { margin: 3px 0 6px; font-size: 11.5px; color: var(--muted); }
.news-text p {
  margin: 0 0 4px; font-size: 13px; color: var(--text); opacity: .9;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.read-more { font-size: 12px; font-weight: bold; }

/* A day's post. */
.article-hero {
  position: relative; overflow: hidden; margin-bottom: 18px; border-radius: 3px;
  border: 2px solid var(--stone-hi); outline: 1px solid var(--stone-lo);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .55);
}
.hero-shot { aspect-ratio: 16 / 6; }
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 14px;
  padding: 50px 18px 14px; background: linear-gradient(transparent, rgba(12, 8, 22, .85) 40%, rgba(12, 8, 22, .97));
}
.hero-text h1 { margin: 0; font: 700 21px/1.3 var(--serif); color: var(--gold); text-shadow: 0 2px 3px #000; }
.hero-text .news-meta { margin: 4px 0 0; }

.news-contents { margin-bottom: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .18); }
.panel-body .news-contents h2 { margin: 0; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--moon); }
.news-index {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px;
}
.news-index.folded li:nth-child(n + 11) { display: none; }
.show-all { margin-top: 10px; font-size: 12px; padding: 6px 14px; cursor: pointer; }
.news-index a {
  display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 3px;
  font-size: 13px; line-height: 1.3; color: var(--text);
}
.news-index a:hover { background: rgba(242, 199, 92, .08); color: var(--gold-hi); text-decoration: none; }
.news-index .tile-shot { flex: 0 0 auto; width: 56px; border: 1px solid var(--stone-hi); border-radius: 2px; }
.news-index .feature-shot.no-shot, .hero-shot.no-shot { background-size: cover !important; background-position: 50% 60% !important; }
.no-shot span { font-size: 12px; right: 3px; bottom: 0; }

.news-section {
  margin: 0 0 16px; padding: 16px 18px 18px; scroll-margin-top: 12px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, rgba(139, 90, 143, .09), rgba(255, 255, 255, .015) 120px);
}
.news-section:target { border-color: var(--gold-lo); box-shadow: 0 0 0 1px var(--gold-lo), 0 0 22px rgba(242, 199, 92, .12); }
.news-section header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 10px; }
.news-section header .news-tag { order: -1; }
.news-section header h2 { flex: 1 1 100%; order: 1; margin: 2px 0 0 !important; font: 700 18px/1.3 var(--serif); color: var(--gold); }
.news-section header .to-top {
  order: 0; margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; font-size: 13px; color: var(--muted);
}
.news-section header .to-top:hover { color: var(--gold-hi); border-color: var(--gold-lo); text-decoration: none; }
.news-changes { list-style: none; margin: 0; padding: 0; }
.news-changes li { position: relative; margin: 0 0 9px; padding-left: 20px; line-height: 1.6; }
.news-changes li:last-child { margin-bottom: 0; }
.news-changes li::before {
  content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px;
  background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 6px rgba(242, 199, 92, .5);
}

.news-gallery { display: grid; gap: 12px; margin-top: 16px; grid-template-columns: repeat(3, 1fr); }
.news-gallery.two { grid-template-columns: repeat(2, 1fr); }
.news-gallery.one { grid-template-columns: minmax(0, 560px); }
.news-gallery figure { margin: 0; min-width: 0; }
.news-gallery a.shot {
  display: block; overflow: hidden; border-radius: 3px; cursor: zoom-in;
  border: 2px solid var(--stone-hi); outline: 1px solid var(--stone-lo);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
}
.news-gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: transform .3s ease, filter .3s; }
.news-gallery a.shot:hover img { transform: scale(1.04); filter: brightness(1.08); }
.news-gallery figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.news-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.news-pager a {
  display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px;
  background: rgba(255, 255, 255, .03); font: 700 13px/1.35 var(--serif);
}
.news-pager a:hover { border-color: var(--gold-lo); text-decoration: none; }
.news-pager small { display: block; margin-bottom: 3px; font-family: inherit; font-weight: normal; font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.news-pager .next { text-align: right; }
.news-pager a span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* The screenshot viewer. */
.viewer {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 20px; background: rgba(8, 5, 16, .92);
}
.viewer[hidden] { display: none; }
.viewer figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.viewer img { max-width: 100%; max-height: calc(100vh - 110px); display: block; margin: 0 auto; border: 2px solid var(--stone-hi); border-radius: 3px; box-shadow: 0 10px 40px #000; }
.viewer figcaption { margin-top: 10px; color: var(--moon); font-size: 14px; }
.viewer button {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--gold-lo); background: rgba(18, 12, 31, .9); color: var(--gold); font-size: 26px; line-height: 1;
}
.viewer button:hover { color: var(--gold-hi); border-color: var(--gold); }
.viewer .viewer-close { position: absolute; top: 14px; right: 14px; }

@media (max-width: 600px) {
  .news-panel .panel-body { padding: 12px; }
  .feature-shot { aspect-ratio: 4 / 3; }
  .feature-caption h2 { font-size: 16px; }
  .hero-shot { aspect-ratio: 4 / 3; }
  .hero-text h1 { font-size: 17px; }
  .date-badge { width: 44px; }
  .date-badge b { font-size: 18px; }
  .news-tiles, .news-feature .news-tiles { grid-template-columns: repeat(2, 1fr); }
  .news-item { gap: 12px; }
  .news-item .news-thumb { width: 96px; }
  .news-section { padding: 14px 12px 14px; }
  .news-gallery, .news-gallery.two { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .news-gallery.one { grid-template-columns: 1fr; }
  .news-gallery figcaption { font-size: 11.5px; }
  .news-pager { grid-template-columns: 1fr; }
  .viewer { padding: 8px; }
  .viewer .viewer-prev, .viewer .viewer-next { position: absolute; bottom: 16px; }
  .viewer .viewer-prev { left: calc(50% - 54px); }
  .viewer .viewer-next { right: calc(50% - 54px); }
}

.back { margin: 16px 0 0; }

/* ---- Play Now ---- */
.play-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: center; margin-bottom: 8px; }
.play-art { width: 100%; display: block; border: 2px solid var(--stone-hi); outline: 1px solid var(--stone-lo); border-radius: 3px; }
.play-cta p { margin: 0 0 12px; }
.play-cta .muted { margin-top: 8px; font-size: 11px; text-align: center; }
.play-cta .muted + .gold-btn { margin-top: 14px; }
.steps { padding-left: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 6px 0 8px 40px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 14px var(--serif); color: #2c2003;
  background: radial-gradient(circle at 35% 30%, #fff1a0, #d4a92c 70%, #8a6512);
  border: 1px solid #3a2e05;
}
.faq { padding-left: 18px; }
.faq li, .guide li { margin: 6px 0; }
.guide ul { padding-left: 18px; }

/* ---- Hiscores ---- */
.skill-icon { width: 16px; height: 16px; flex: 0 0 16px; vertical-align: -3px; }
.hiscores { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: start; }
.skill-list {
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 3px; padding: 4px;
}
.skill-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px; color: var(--text); border-radius: 2px;
}
.skill-list a:hover { background: rgba(255, 255, 255, .06); color: var(--gold-hi); text-decoration: none; }
.skill-list a.active { background: linear-gradient(90deg, rgba(242, 199, 92, .3), rgba(242, 199, 92, .05)); color: var(--gold-hi); font-weight: bold; }
.table-wrap { overflow-x: auto; }
table.scores { width: 100%; border-collapse: collapse; }
.scores th, .scores td { padding: 6px 10px; text-align: left; white-space: nowrap; }
.scores th {
  font: 700 12px var(--serif); color: var(--gold);
  background: linear-gradient(#4a463e, #322f2a);
  border-bottom: 2px solid var(--stone-lo);
}
.scores tbody tr:nth-child(odd) { background: var(--row); }
.scores tbody tr:hover { background: rgba(160, 120, 220, .12); }
.scores tr.overall { background: rgba(242, 199, 92, .08) !important; font-weight: bold; }
.scores td.num, .scores th.num { text-align: right; font-variant-numeric: tabular-nums; }
.skill-cell { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.progress { width: 110px; }
.bar { height: 7px; background: #0c0814; border: 1px solid #000; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5a8f, var(--gold)); }

/* ---- Player page ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stat {
  text-align: center; padding: 8px 6px;
  background: linear-gradient(#2a2238, #1a1426);
  border: 1px solid var(--line); border-radius: 3px;
}
.stat b { display: block; font: 900 22px var(--serif); color: var(--gold); text-shadow: 0 2px 2px #000; }
.stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* ---- Grand Exchange ---- */
.tag { display: inline-block; font-size: 11px; font-weight: bold; padding: 0 6px; border-radius: 2px; border: 1px solid; }
.tag.buy { color: var(--green); border-color: #3f6a2c; background: #142010; }
.tag.sell { color: var(--red); border-color: #74321f; background: #2a120b; }

/* ---- Sidebar ---- */
.box h2 {
  margin: 0; padding: 8px 12px 7px;
  font: 700 14px var(--serif); color: var(--gold); text-shadow: 0 2px 2px #000;
  background: linear-gradient(#4f4b43, #34312c);
  border-bottom: 2px solid var(--stone-lo);
  box-shadow: inset 0 1px 0 #7d786c;
}
.box > :not(h2) { margin: 12px; }
.play-box { background: linear-gradient(rgba(22, 17, 30, .6), rgba(22, 17, 30, .95)), url("/art/background.png") 80% 70% / 260% auto; }
.side-online { text-align: center; font-size: 11px; color: var(--moon); }
.discord-box p { font-size: 12px; text-align: center; color: var(--moon); }
.discord-box .stone-btn { display: block; text-align: center; }
[hidden] { display: none !important; }
.status-line { display: flex; align-items: center; gap: 8px; }
.online-list { list-style: none; padding: 0; margin: 0 12px 12px !important; columns: 2; font-size: 12px; }
#lookup { display: flex; gap: 6px; }
#lookup input {
  flex: 1; min-width: 0; padding: 6px 8px; font: inherit; color: var(--text);
  background: #0e0a16; border: 1px solid var(--stone-hi); border-radius: 3px;
  box-shadow: inset 0 2px 4px #000;
}
#lookup .gold-btn { padding: 5px 10px; font-size: 12px; }
.side-top { padding-left: 26px; margin: 10px 12px 12px; }
.side-top li { padding: 2px 0; }
.side-top li span { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Footer ---- */
footer {
  margin-top: 8px; padding: 14px 0 34px;
  text-align: center; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--line);
}
footer nav { margin-bottom: 6px; color: var(--stone-hi); }
footer nav a { margin: 0 6px; }
footer p { margin: 4px 0; }

/* ---- Small screens ---- */
@media (max-width: 820px) {
  .columns { grid-template-columns: 1fr; }
  .hiscores { grid-template-columns: 1fr; }
  .skill-list { flex-direction: row; overflow-x: auto; }
  .skill-list a { white-space: nowrap; }
  .play-hero { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .banner { height: 170px; padding: 0 16px; flex-direction: column; justify-content: center; }
  .logo img { width: 200px; }
  .play-now { padding: 8px 22px 6px; }
  .play-now span { font-size: 20px; }
  .menu a { font-size: 13px; padding: 8px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .news-thumb { flex-basis: 64px; height: 56px; }
  .progress { display: none; }
  .welcome { background: linear-gradient(rgba(18, 12, 31, .85), rgba(18, 12, 31, .85)), url("/art/loading.png") center / cover; }
}

/* ---- Grand Exchange ---- */
.ge-search { display: flex; gap: 8px; margin-bottom: 12px; }
.ge-search input, .ge-search select {
  padding: 6px 8px; font: inherit; color: var(--text);
  background: #0e0a16; border: 1px solid var(--stone-hi); border-radius: 3px;
  box-shadow: inset 0 2px 4px #000;
}
.ge-search input { flex: 1; min-width: 0; }
.scores .members { color: var(--gold); font-size: 11px; }
.ge-more { margin: 10px 0 0; font-size: 12px; }

/* ---- News contents and feed link ---- */
.rss-link { margin-left: 6px; font-size: 11px; }
/* ---- Adventurer's Log ---- */
.adv-log { list-style: none; margin: 0; padding: 0; }
.adv-log li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.adv-log li:last-child { border-bottom: 0; }
.adv-log b { color: var(--moon); }
.adv-log p { margin: 2px 0 0; color: var(--muted); }
.adv-log time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.log-glyph { font-size: 15px; text-align: center; color: var(--gold); text-shadow: 0 0 6px rgba(242, 199, 92, .5); }
.log-quest .log-glyph { color: #c8a4f0; text-shadow: 0 0 6px rgba(200, 164, 240, .5); }
.log-drop .log-glyph { color: #7fd8e8; text-shadow: 0 0 6px rgba(127, 216, 232, .5); }

/* ---- Quests ---- */
.quest-list { border-top: 1px solid var(--line); }
.quest { border-bottom: 1px solid var(--line); }
.quest summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 4px; cursor: pointer; list-style: none;
}
.quest summary::-webkit-details-marker { display: none; }
.quest summary::before { content: "▸"; color: var(--gold); width: 10px; transition: transform .15s; }
.quest[open] summary::before { transform: rotate(90deg); }
.quest summary:hover { background: rgba(255, 255, 255, .03); }
.quest-name { font: 700 14px var(--serif); color: var(--gold); }
.quest-done { margin-left: auto; font-size: 11px; }
.quest dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 14px; margin: 0 0 12px 24px; }
.quest dt { color: var(--muted); }
.quest dd { margin: 0; }
.tag.members-tag { color: var(--gold); border-color: var(--gold-lo); background: rgba(242, 199, 92, .08); }
.tag.free-tag { color: var(--moon); border-color: var(--stone-hi); background: rgba(255, 255, 255, .04); }
.soon summary { cursor: pointer; color: var(--gold); margin-bottom: 8px; }
.soon-list { columns: 3; column-gap: 20px; padding-left: 18px; margin: 0; font-size: 12px; }
.player-quests { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.player-quests li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; break-inside: avoid; border-bottom: 1px dotted var(--line); }
.player-quests span { font-size: 11px; }
.q-done span { color: var(--green); }
.q-started span { color: var(--gold); }
.q-todo a { color: var(--muted); }
.q-todo span { color: var(--red); }

/* ---- Hiscores extras and compare ---- */
.nav-label { padding: 8px 8px 2px; font: 700 11px var(--serif); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.compare-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.compare-form input {
  flex: 1 1 140px; min-width: 0; padding: 6px 8px; font: inherit; color: var(--text);
  background: #0e0a16; border: 1px solid var(--stone-hi); border-radius: 3px; box-shadow: inset 0 2px 4px #000;
}
.compare-form span { color: var(--muted); font: 700 13px var(--serif); }
.scores td.win { color: var(--green); font-weight: bold; }
.scores td.win .muted { font-weight: normal; }

/* ---- Clans ---- */
.motto { margin: 0 0 14px; font: italic 15px Georgia, serif; color: var(--moon); text-align: center; }

/* ---- Guides and Bestiary ---- */
.guide-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 10px; margin-bottom: 8px; }
.guide-skills a { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 2px; }
.guide-skills a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.panel-head h1 .skill-icon { width: 20px; height: 20px; flex-basis: 20px; }

/* ---- GE price chart ---- */
.stats:has(.stat:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.chart { margin: 4px 0 0; }
.chart svg { width: 100%; height: auto; display: block; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 3px; }
.chart text { fill: var(--muted); font: 11px Verdana, sans-serif; }
.chart .grid { stroke: var(--line); }
.chart .guide-line { stroke: var(--mauve); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .price-line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; }
.chart circle { fill: var(--gold-hi); stroke: var(--night); stroke-width: 1.5; }
.chart figcaption { display: flex; gap: 16px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.key::before { content: ""; display: inline-block; width: 16px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2.5px solid var(--gold); }
.key.guide::before { border-top: 1.5px dashed var(--mauve); }

@media (max-width: 820px) {
  .skill-list .nav-label { display: none; }
}
@media (max-width: 600px) {
  .player-quests { columns: 1; }
  .soon-list { columns: 2; }
  .quest dl { grid-template-columns: 1fr; margin-left: 8px; }
  .quest dt { margin-top: 6px; }
  .quest-done { margin-left: 0; width: 100%; }
  .adv-log li { grid-template-columns: 22px minmax(0, 1fr); }
  .adv-log time { grid-column: 2; }
}
