@font-face { font-family: "RS Bold"; src: url(../assets/fonts/rs-bold-12.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "RS Plain"; src: url(../assets/fonts/rs-plain-12.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "RS Small"; src: url(../assets/fonts/rs-plain-11.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "RS Quill"; src: url(../assets/fonts/rs-quill.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #15110b;
  --panel: #2b2318;
  --panel-2: #221c12;
  --well: #1b150e;
  --line: #4a3e2d;
  --line-hi: #5c4c34;
  --line-lo: #0f0b06;
  --text: #d8cfb8;
  --muted: #a08a5f;
  --yellow: #ffff00;
  --gold: #ffcf3f;
  --gold-hi: #ffe9a8;
  --orange: #ff981f;
  --green: #00e000;
  --red: #c80000;
  --pet: #ffb020;
  --mythic: #b24cff;
  --rare: #4090ff;
  --uncommon: #48c858;
  --common: #a8a8a8;
  --shadow: 2px 2px 0 #000;
  --rs: "RS Bold", "Jersey 15", monospace;
  --rs-plain: "RS Plain", "RS Bold", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg) url(../assets/img/brick.png) repeat;
  background-size: 64px 32px;
  color: var(--text);
  font: 16px/1.45 var(--rs-plain);
  -webkit-font-smoothing: none;
  font-smooth: never;
}
img { image-rendering: auto; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--rs); font-weight: normal; margin: 0; text-shadow: var(--shadow); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.label { display: block; font-family: var(--rs-plain); color: var(--muted); font-size: 16px; }
.num { font-family: var(--rs); color: var(--yellow); text-shadow: var(--shadow); font-size: 24px; }

/* ---------- header ---------- */
.top { background: linear-gradient(#0f0b06ee, #0f0b06aa); border-bottom: 2px solid var(--line-lo); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(2px); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { display: block; font-family: var(--rs); color: var(--gold); font-size: 28px; text-shadow: var(--shadow); line-height: 1; }
.brand-sub { display: block; color: var(--muted); font-size: 16px; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.top-actions { display: flex; gap: 8px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.nav a { font-family: var(--rs); color: var(--orange); font-size: 22px; text-decoration: none; text-shadow: var(--shadow); }
.nav a:hover { color: var(--yellow); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; font: 22px var(--rs); text-decoration: none; cursor: pointer; border: 2px solid var(--line-lo); }
.btn-gold { background: linear-gradient(#ffd83a, #e0a800); color: #2a1c00; box-shadow: inset 0 2px 0 #fff3a0, inset 0 -3px 0 #a87400; }
.btn-gold:hover { background: linear-gradient(#ffe46a, #efb800); color: #2a1c00; }
.btn-stone { background: linear-gradient(#4a3e2d, #34291b); color: var(--orange); box-shadow: inset 0 2px 0 var(--line-hi), inset 0 -2px 0 #1b150e; text-shadow: var(--shadow); }
.btn-stone:hover { color: var(--yellow); }

/* ---------- OSRS panels ---------- */
.panel {
  background: var(--panel);
  border: 2px solid var(--line-lo);
  box-shadow: inset 0 0 0 2px var(--line), inset 0 0 0 4px var(--line-lo), 0 6px 24px #0008;
  padding: 6px;
}
.section { margin: 32px 0; padding: 28px; }
.section-head { margin-bottom: 20px; }
.section-head h2 { font-size: 40px; color: var(--gold); }
.section-head p { margin: 6px 0 0; max-width: 760px; }

.tabs { display: flex; gap: 4px; }
.tab { font: 20px var(--rs); padding: 8px 16px; color: var(--text); background: var(--panel-2); border: 2px solid var(--line-lo); box-shadow: inset 0 2px 0 var(--line); text-shadow: var(--shadow); }
.tab-on { color: var(--orange); background: linear-gradient(#4a3e2d, #3d3325); box-shadow: inset 0 2px 0 var(--line-hi), inset 0 0 0 1px #6b5a3d; }
button.tab { cursor: pointer; min-height: 44px; }
button.tab:hover { color: var(--yellow); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; margin-top: 32px; }
.boss-panel { padding: 16px; }
.boss-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; padding: 20px 8px 8px; }
.boss-art { background: radial-gradient(circle at 50% 55%, #4a2a10 0%, var(--well) 70%); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 2px var(--line); aspect-ratio: 1; padding: 20px; overflow: hidden; }
.boss-art img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 12px 12px #000a); }
.boss-info h1 { font-size: 52px; color: var(--yellow); line-height: 1; }
.flavor { font-family: var(--rs-plain); color: var(--gold-hi); margin: 10px 0 20px; font-size: 18px; }

.hp-head { display: flex; justify-content: space-between; align-items: baseline; }
.hp-bar { height: 22px; background: var(--red); border: 2px solid #000; margin: 6px 0; position: relative; }
.hp-fill { height: 100%; background: var(--green); width: 100%; transition: width .6s steps(24); }
.hp-note { margin: 4px 0 18px; font-size: 16px; color: var(--text); }
.hp-note b { color: var(--yellow); font-weight: normal; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stat { background: var(--well); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 1px var(--line); padding: 10px 12px; }

.drops-mini .mini-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.mini { width: 64px; height: 64px; background: var(--well); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 2px var(--tc, var(--line)); display: grid; place-items: center; padding: 6px; cursor: pointer; }
.mini img { width: 100%; height: 100%; object-fit: contain; display: block; }
.more { font-family: var(--rs); font-size: 20px; text-shadow: var(--shadow); }

/* ---------- examine ---------- */
.examine { padding: 0; align-self: start; }
.examine-head { background: linear-gradient(#4a3e2d, #34291b); padding: 18px 22px; border-bottom: 2px solid var(--line-lo); }
.examine-head h2 { font-size: 30px; color: var(--gold); }
.examine-body { padding: 18px 22px 22px; }
.field { display: block; margin: 14px 0; }
.field > span { display: flex; justify-content: space-between; font-family: var(--rs); font-size: 20px; color: var(--orange); text-shadow: var(--shadow); }
.field output { color: var(--yellow); }
input[type=range] { width: 100%; accent-color: var(--gold); height: 32px; }
.mult { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; background: var(--well); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 1px var(--line); padding: 12px; margin: 16px 0 12px; text-align: center; }
.mult .x { font: 24px var(--rs); color: var(--muted); }
.mult .total .num { color: var(--green); font-size: 28px; }
.ca { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 18px; }
.ca .label { grid-column: 1 / -1; }
.ca code { font: 18px var(--rs-plain); background: var(--well); border: 2px solid var(--line-lo); padding: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold-hi); }

/* ---------- hitsplats + overhead health bar ---------- */
.boss-art { position: relative; }
.overhead { position: absolute; left: 50%; top: 14px; width: 36%; height: 12px; transform: translateX(-50%); background: var(--red); border: 2px solid #000; }
.overhead div { height: 100%; width: 100%; background: var(--green); }
.splats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.splat { position: absolute; min-width: 60px; height: 52px; padding: 0 12px; transform: translate(-50%, -50%); display: grid; place-items: center; animation: splat 1.3s steps(13) forwards; }
.splat svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.splat path { fill: #c01010; stroke: #000; stroke-width: 4; }
.splat.miss path { fill: #1f4fe0; }
.splat span { position: relative; font: 26px/1 var(--rs); color: #fff; text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; }
@keyframes splat { 0% { transform: translate(-50%, -50%) scale(1.4); } 12% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; transform: translate(-50%, -60%); } 100% { opacity: 0; transform: translate(-50%, -70%); } }
.boss-art.hit img { animation: boss-hit .32s steps(6); }
@keyframes boss-hit { 30% { transform: translateX(-5px); filter: drop-shadow(0 12px 12px #000a) brightness(1.3) sepia(.5) saturate(3) hue-rotate(-20deg); } 65% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  .splat { animation: splat-still 1.3s steps(2) forwards; }
  .boss-art.hit img { animation: none; }
}
@keyframes splat-still { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.loot .dropped { display: block; font: 16px var(--rs-plain); color: var(--muted); margin: 2px 0 0 56px; }
.loot .dropped a { font-family: var(--rs); color: var(--gold); }

/* ---------- game chat ---------- */
.chat { margin-top: 24px; padding: 0; }
.chat-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 14px 0; }
.chat-note { color: var(--muted); font-size: 16px; }
.chat-lines { list-style: none; margin: 8px; padding: 10px 14px; height: 236px; overflow-y: auto; overscroll-behavior: contain;
  background: #0f0b06d9; border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 1px var(--line);
  font: 18px/1.45 var(--rs-plain); color: #f0e6cc; text-shadow: 1px 1px 0 #000; }
.chat-lines li { overflow-wrap: anywhere; }
.chat-lines li.new { animation: chat-in .3s steps(4); }
@keyframes chat-in { from { opacity: 0; transform: translateX(-14px); } }
.chat-lines a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.chat-lines a:hover { color: var(--yellow); }
.chat-lines .c-r { color: #ff3a3a; } .chat-lines .c-y { color: var(--yellow); } .chat-lines .c-g { color: #3dff3d; } .chat-lines .c-c { color: #6fe7ff; } .chat-lines .c-o { color: var(--orange); }
.chat-lines .c-pet { color: var(--pet); } .chat-lines .c-mythic { color: #c77dff; } .chat-lines .c-rare { color: var(--rare); } .chat-lines .c-uncommon { color: var(--uncommon); } .chat-lines .c-common { color: var(--common); }
@media (prefers-reduced-motion: reduce) { .chat-lines li.new { animation: none; } }

/* ---------- ladder ---------- */
.wave + .wave { margin-top: 22px; }
.wave-head { font-size: 26px; color: var(--orange); margin: 0 0 10px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.wave-head span { font: 20px var(--rs); color: var(--gold-hi); text-shadow: var(--shadow); }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.rung button { width: 100%; text-align: left; background: var(--panel-2); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 2px var(--line); padding: 12px; cursor: pointer; color: var(--text); font: inherit; display: grid; gap: 8px; min-height: 44px; position: relative; }
.rung button:hover { box-shadow: inset 0 0 0 2px var(--gold); }
.rung .art { aspect-ratio: 4 / 3; display: block; overflow: hidden; background: radial-gradient(circle at 50% 60%, #3a2412 0%, var(--well) 72%); border: 2px solid var(--line-lo); padding: 10px; }
.rung .art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rung .no { font: 18px var(--rs); color: var(--muted); }
.rung .nm { font: 22px var(--rs); color: var(--orange); text-shadow: var(--shadow); line-height: 1.05; }
.rung .mc { font: 20px var(--rs); color: var(--yellow); text-shadow: var(--shadow); }
.rung .st { position: absolute; top: 18px; right: 18px; font: 16px var(--rs); padding: 3px 8px; border: 2px solid #000; text-shadow: none; }
.rung.slain .st { background: var(--green); color: #002a00; }
.rung.slain .art img { filter: grayscale(1) brightness(.55); }
.rung.slain .art::after { content: ""; position: absolute; }
.rung.fighting button { box-shadow: inset 0 0 0 3px var(--gold); }
.rung.fighting .st { background: var(--gold); color: #2a1c00; }
.rung.locked .art img { filter: brightness(0) drop-shadow(0 0 1px #6b5a3d); opacity: .8; }
.rung.locked .st { background: var(--panel); color: var(--muted); }
.rung.selected button { box-shadow: inset 0 0 0 3px var(--yellow); }

/* ---------- loot table ---------- */
.loot-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.select select, #loot-search { font: 20px var(--rs-plain); color: var(--gold-hi); background: var(--well); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 1px var(--line); padding: 8px 12px; min-height: 44px; }
.select select { font-family: var(--rs); color: var(--orange); }
#loot-search { flex: 1 1 200px; min-width: 0; }
.tier-tabs { flex-wrap: wrap; }
.tier-tabs .tab[data-tier] { color: var(--tc); }
.table-wrap { overflow: auto; max-height: 720px; border: 2px solid var(--line-lo); background: var(--well); }
table.loot { width: 100%; border-collapse: collapse; }
.loot th { font: 18px var(--rs); color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.loot td { padding: 6px 12px; border-bottom: 1px solid #2d2518; vertical-align: middle; }
.loot tr:hover td { background: #2b2318; }
.loot .c-no { width: 64px; color: var(--muted); }
.loot .it { display: flex; align-items: center; gap: 12px; }
.loot .it img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.loot .it span { font: 20px var(--rs); color: var(--tc); text-shadow: var(--shadow); }
.badge { display: inline-block; font: 16px var(--rs); padding: 2px 8px; color: #000; background: var(--tc); border: 1px solid #000; }
.loot .rate { font: 18px var(--rs-plain); color: var(--text); }
.loot .copies { font: 16px var(--rs); color: var(--gold-hi); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; text-shadow: none; }
.loot .c-view { width: 60px; }
.view-btn { min-height: 36px; min-width: 44px; padding: 0 10px; font-size: 18px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step { background: var(--panel-2); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 2px var(--line); padding: 18px; }
.step-no { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--gold); color: #2a1c00; font: 22px var(--rs); border: 2px solid #000; margin-bottom: 10px; }
.step h3 { font-size: 26px; color: var(--orange); margin-bottom: 6px; }
.step p { margin: 0; }
.fair { margin-top: 16px; background: var(--well); border: 2px solid var(--line-lo); padding: 16px 18px; }
.fair h3 { color: var(--green); font-size: 24px; }
.fair p { margin: 6px 0 0; }

/* ---------- drop log ---------- */
.log-boss { margin-bottom: 18px; }
.log-boss h3 { color: var(--orange); font-size: 24px; }
.log-boss code { color: var(--gold-hi); word-break: break-all; }

/* ---------- footer ---------- */
.foot { border-top: 2px solid var(--line-lo); background: #0f0b06cc; padding: 24px 0 40px; margin-top: 48px; }
.foot p { margin: 4px 0; }

/* ---------- game updates ---------- */
.updates { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.quest { background: linear-gradient(#e4d5ad, #cdb98c); color: #2a1c00; border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 3px #a88e5a, inset 0 0 28px #7a5c2a55; padding: 20px 22px; }
.quest-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.quest h3 { font: 38px/1 "RS Quill", var(--rs); color: #3b1a00; text-shadow: none; }
.quest-state { font: 20px var(--rs); color: #c80000; }
.quest dl { margin: 16px 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.quest dt { font: 20px var(--rs); color: #5a3a10; }
.quest dd { margin: 0; font: 20px var(--rs-plain); }
.quest dd.unknown { font-family: var(--rs); color: #c80000; letter-spacing: 2px; }
.quest-note { margin: 0; font: 24px/1.3 "RS Quill", var(--rs-plain); color: #3b2a10; }
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; background: var(--panel-2); border: 2px solid var(--line-lo); box-shadow: inset 0 0 0 2px var(--line); padding: 14px 16px; }
.news .meta { display: grid; gap: 6px; justify-items: start; }
.news .tag { font: 18px var(--rs); padding: 2px 8px; border: 2px solid #000; }
.news .shipped .tag { background: var(--green); color: #002a00; }
.news .soon .tag { background: var(--gold); color: #2a1c00; }
.news .date { font-size: 16px; color: var(--muted); }
.news h3 { font-size: 24px; color: var(--orange); }
.news .soon h3 { color: var(--muted); letter-spacing: 3px; }
.news p { margin: 4px 0 0; }
.news .soon p { color: var(--gold-hi); }
.examine-text { margin: 10px 0 14px; color: var(--gold-hi); }
.examine-text .label { display: block; }

/* ---------- dialog ---------- */
dialog { padding: 0; border: 2px solid var(--line-lo); background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 2px var(--line), 0 20px 60px #000; max-width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: #000b; }
.dlg-inner { display: grid; grid-template-columns: 512px 1fr; gap: 20px; padding: 16px; }
.dlg-inner img { width: 100%; height: auto; display: block; }
.dlg-side h3 { font-size: 30px; color: var(--yellow); }
.dlg-side p { white-space: pre-line; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .updates { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .chat-lines { height: 210px; font-size: 16px; margin: 6px; padding: 8px 10px; }
  .chat-note { font-size: 14px; }
  .news li { grid-template-columns: 1fr; gap: 8px; }
  .news .meta { display: flex; gap: 10px; align-items: baseline; }
  .nav { display: none; }
  .top-inner { gap: 12px; }
  .top-actions { margin-left: auto; }
  .top-actions .btn { padding: 0 10px; font-size: 18px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 22px; }
  .boss-body { grid-template-columns: 1fr; padding: 12px 0 0; }
  .boss-art { max-width: 320px; width: 100%; margin: 0 auto; }
  .boss-info h1 { font-size: 40px; }
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .section { padding: 18px 14px; }
  .section-head h2 { font-size: 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .dlg-inner { grid-template-columns: 1fr; }
  .loot th:nth-child(3), .loot td:nth-child(3) { display: none; }
  .loot td { padding: 6px 8px; }
  .loot .it span { font-size: 18px; }
}
