/* Scapelike Idle — OSRS-flavored UI. Palette: dark brown panels #3e3529/#494034,
   parchment #d8ccb4, gold #ff981f, hitsplat red #c02316. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Topbar (~48px) + footer (~52px) + the layout's 14px padding top and bottom.
   * Only used to bound the centre column against the viewport. */
  --page-chrome: 130px;
  --panel: #3e3529;
  --panel2: #494034;
  --edge: #5a4e3c;
  --edge-dark: #2b251c;
  --parchment: #d8ccb4;
  --gold: #ff981f;
  --red: #c02316;
  --green: #35b839;
  --purple: #b44cff;
  --dim: #9a8f7a;
}

html, body { height: 100%; }
body {
  font-family: 'VT323', monospace;
  font-size: 19px;
  background: #262119;
  background-image: radial-gradient(1200px 500px at 50% -150px, #383024, #262119 70%);
  background-attachment: fixed;
  color: var(--parchment);
  letter-spacing: 0.3px;
}

img { max-width: 100%; image-rendering: pixelated; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  font-family: inherit; font-size: 17px; cursor: pointer;
  background: var(--panel2); color: var(--parchment);
  border: 2px solid var(--edge); padding: 4px 12px;
}
button:hover { border-color: var(--gold); color: var(--gold); }
input {
  font-family: inherit; font-size: 18px;
  background: #241f17; color: var(--parchment);
  border: 2px solid var(--edge); padding: 6px 8px; width: 100%;
}
input:focus { outline: none; border-color: var(--gold); }
input[type=color] { width: 44px; height: 32px; padding: 2px; vertical-align: middle; }

/* ------------------------------------------------------------- top bar --- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(#4a4034, #3e3529);
  border-bottom: 3px solid var(--edge-dark);
  box-shadow: 0 2px 0 var(--edge) inset;
  padding: 8px 18px;
}
.logo { font-size: 26px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.topbar nav { display: flex; gap: 18px; font-size: 20px; }
.topbar nav a.here { color: #fff; border-bottom: 2px solid var(--gold); }
.userbox { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--dim); }
.userbox #who { color: var(--parchment); }

/* -------------------------------------------------------------- layout --- */
.game-layout {
  display: grid;
  grid-template-columns: 290px 1fr 270px;
  gap: 14px;
  padding: 14px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 1000px) { .game-layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 3px solid var(--edge-dark);
  box-shadow: 0 0 0 2px var(--edge) inset;
  padding: 12px;
}
.panel h2 {
  font-size: 21px; color: var(--gold); margin-bottom: 8px;
  text-shadow: 1px 1px 0 #000;
}

/* ----------------------------------------------------------- boss list --- */
#boss-list { max-height: calc(100vh - 220px); overflow-y: auto; }
.tier-label { color: var(--dim); margin: 10px 0 4px; border-bottom: 1px solid var(--edge); font-size: 17px; }
.boss-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px; margin: 2px 0; cursor: pointer;
  border: 2px solid transparent;
}
.boss-row:hover { background: var(--panel2); border-color: var(--edge); }
.boss-row.active { background: #55461f; border-color: var(--gold); }
.boss-row img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.boss-row .bname { flex: 1; line-height: 1.05; }
.boss-row .bkc { color: var(--gold); font-size: 16px; }
.boss-row.locked { cursor: not-allowed; opacity: 0.55; }
.boss-row.locked img { filter: grayscale(1) brightness(0.6); }
.boss-row.locked .block { font-size: 14px; color: var(--dim); max-width: 120px; text-align: right; line-height: 1; }

/* --------------------------------------------------------------- stage --- */
/* Anchoring the centre column to the viewport is what lets the chat below use
 * `flex: 1` at all. Without it the grid row's height is DERIVED from its
 * contents, so the chat growing simply makes room for itself — circular, and
 * the reason the panel used to run away down the page. The left panel already
 * anchors itself the same way (#boss-list, above). */
#stage {
  display: flex; flex-direction: column; gap: 10px;
  /* A DEFINITE height, not max-height. `flex: 1` on the chat below grows into
   * free space, and a max-height only caps — the grid row would still be sized
   * from its contents, leaving no free space and pinning the chat at its floor
   * on every screen. This is the line that makes the chat scale with the
   * window. */
  height: calc(100vh - var(--page-chrome));
  height: calc(100dvh - var(--page-chrome));
}
/*
 * Nothing above the chat may be squeezed to make room for it. A flex item's
 * default flex-shrink is 1, so once #stage is height-bounded the arena's
 * `height: 380px` becomes a mere suggestion — it was collapsing to 69px on a
 * 1080p screen as the chat filled. The :not() keeps this independent of source
 * order, rather than relying on a later rule to win.
 */
#stage > *:not(#chatbox) { flex: none; }
#arena {
  position: relative;
  height: 380px;
  background: radial-gradient(ellipse at 50% 65%, #51462f 0%, #3a3226 45%, #2b251c 100%);
  border: 3px solid var(--edge-dark);
  box-shadow: 0 0 0 2px var(--edge) inset, 0 0 60px rgba(0,0,0,.5) inset;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#boss-wrap {
  position: relative; z-index: 2;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(-6px); }
  50%      { transform: translateY(6px); }
}
#boss-img {
  max-height: 280px; max-width: 420px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.6));
}
#boss-img.lunge { animation: lunge 0.15s ease-out; }
@keyframes lunge {
  0%   { transform: translate(0, 0); }
  35%  { transform: translate(-10px, 6px) scale(1.05); }
  70%  { transform: translate(4px, -2px); }
  100% { transform: translate(0, 0); }
}
#boss-shadow {
  position: absolute; bottom: 26px; left: 50%; z-index: 1;
  width: 180px; height: 26px; margin-left: -90px;
  background: radial-gradient(ellipse, rgba(0,0,0,.55), transparent 70%);
  animation: shadowpulse 2.2s ease-in-out infinite;
}
@keyframes shadowpulse {
  0%, 100% { transform: scaleX(0.85); opacity: .7; }
  50%      { transform: scaleX(1.05); opacity: 1; }
}
#loot-beam {
  position: absolute; bottom: 10%; left: 50%; z-index: 0;
  width: 110px; height: 92%; margin-left: -55px;
  background: linear-gradient(to top, rgba(180,76,255,.6), rgba(180,76,255,.25) 55%, transparent);
  filter: blur(3px);
  opacity: 0; transition: opacity .4s;
  pointer-events: none;
}
#loot-beam.show { opacity: 1; animation: beamflicker 0.9s ease-in-out infinite; }
@keyframes beamflicker { 0%,100% { filter: blur(3px) brightness(1); } 50% { filter: blur(4px) brightness(1.35); } }

#hitsplats { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hitsplat {
  position: absolute;
  width: 44px; height: 44px;
  background: var(--red);
  border-radius: 8px;
  box-shadow: 0 0 0 2px #7e150c inset, 2px 2px 4px rgba(0,0,0,.5);
  color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  animation: splat 0.8s ease-out forwards;
}
@keyframes splat {
  0%   { transform: scale(0.3); opacity: 0; }
  12%  { transform: scale(1.2); opacity: 1; }
  28%  { transform: scale(1); }
  75%  { opacity: 1; }
  100% { transform: translateY(-26px) scale(0.9); opacity: 0; }
}

#boss-title { text-align: center; font-size: 30px; color: #fff; text-shadow: 2px 2px 0 #000; }
#boss-title .style-tag { font-size: 17px; color: var(--dim); }

.killbar {
  height: 24px;
  background: #241f17;
  border: 2px solid var(--edge);
  box-shadow: 0 0 0 1px #000 inset;
  position: relative;
}
#killbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(#ffb051, var(--gold) 45%, #c96e00);
}
.killbar .kb-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; text-shadow: 1px 1px 0 #000;
}

/* --------------------------------------------------------------- stats --- */
#stats .stat-line { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted var(--edge); }
#stats .stat-line b { color: var(--gold); font-weight: normal; }
.powergrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; text-align: center; }
.powergrid .pcell { background: var(--panel2); border: 2px solid var(--edge); padding: 5px 2px; }
.powergrid .pcell .pv { font-size: 24px; color: var(--gold); }
.powergrid .pcell .pl { font-size: 14px; color: var(--dim); }
#next-unlock { margin-top: 10px; color: var(--dim); font-size: 17px; line-height: 1.3; }
#next-unlock b { color: var(--parchment); }

/* ------------------------------------------------------------- chatbox --- */
/* The chat and drop feed live in the CENTRE column under the KC bar, in a
 * fixed window of --chat-lines lines with the history scrollable above it.
 *
 * It used to be `flex: 1` against a parent with no height of its own, so there
 * was nothing to fill and nothing to overflow: the panel simply grew downwards
 * for every message and the scrollbar never appeared. Sizing the viewport in
 * LINES rather than pixels keeps it to the same number of messages after the
 * font size changes on small screens. */
#chatbox {
  display: flex; flex-direction: column;
  /* DESKTOP: take whatever height the arena leaves, with a floor so a short
   * laptop window cannot squeeze the chat to nothing. This works only because
   * #stage is bounded above; on its own it is the runaway-growth bug.
   *
   * The basis is 0, NOT auto. With `auto` a flex item's base size is its
   * CONTENT, so every message made the box want to be bigger, and the overflow
   * that created got taken out of the arena above. Basis 0 means the height
   * comes from the space available and nothing else — message count cannot
   * influence the layout at all. */
  flex: 1 1 0;
  min-height: 210px;
  /*
   * ...and a ceiling, so a tall monitor gets a generous chat rather than an
   * absurd one. 16 lines of #chat-inner's 18px/1.3 type (23.4px each), plus its
   * 8px padding top and bottom, plus 53px for the input row and borders — that
   * last figure measured by `npm run layout`, which also asserts the resulting
   * line count. `em` is deliberately not used here: on #chatbox it would
   * resolve against this element's inherited font-size, not the 18px set on
   * #chat-inner below, and would silently give the wrong number of lines.
   */
  --chat-max-lines: 16;
  max-height: calc(var(--chat-max-lines) * 23.4px + 16px + 53px);
  background: #2f2a20;
  border: 3px solid var(--edge-dark);
  box-shadow: 0 0 0 2px var(--edge) inset;
}
#chat-inner {
  --chat-pad: 8px;
  flex: 1 1 auto;
  /* Required, not decorative: a flex item's automatic minimum is its content,
   * so without this it refuses to shrink and never scrolls. */
  min-height: 0;
  /* `scroll` rather than `auto` keeps the bar present, so the text never
   * reflows sideways the moment the panel first overflows. */
  overflow-y: scroll;
  padding: var(--chat-pad) 12px; font-size: 18px; line-height: 1.3;
  /* Long words and pasted URLs wrap instead of forcing a sideways scroll. */
  overflow-wrap: anywhere;
  /* Firefox; the WebKit equivalent is below. */
  scrollbar-width: thin;
  scrollbar-color: var(--edge) #241f18;
}
#chat-inner::-webkit-scrollbar { width: 12px; }
#chat-inner::-webkit-scrollbar-track { background: #241f18; }
#chat-inner::-webkit-scrollbar-thumb {
  background: var(--edge);
  border: 2px solid #241f18;
}
#chat-inner::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* SINGLE COLUMN (phones and narrow tablets). Deliberately the opposite rule:
 * here the page is one long scroll, so "fill the viewport" means nothing — and
 * a tall scrollable panel sitting mid-page captures the touch drags that were
 * meant to scroll the page, which is how a widget becomes a wall. Fixed, and
 * shorter than desktop: something you scroll past rather than get stuck in.
 * Sized in LINES so the smaller type at 700px shows the same six messages
 * rather than a different number. */
@media (max-width: 1000px) {
  #stage { height: auto; max-height: none; }
  #chatbox { --chat-lines: 6; flex: none; min-height: 0; }
  #chat-inner {
    flex: none;
    /* 1.3em == the line-height, and the padding is added back because
     * box-sizing is border-box globally — without that term it eats a line. */
    height: calc(var(--chat-lines) * 1.3em + var(--chat-pad) * 2);
  }
}
#chat-inner .line { color: var(--parchment); }
#chat-inner .line.drop { color: var(--gold); }
#chat-inner .line.rare { color: var(--purple); }
#chat-inner .line.pet { color: var(--green); }
#chat-inner .line.sys { color: var(--dim); }

/* -------------------------------------------------------------- toasts --- */
#toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; gap: 12px; align-items: center;
  min-width: 260px; max-width: 340px;
  background: var(--panel);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,.6);
  padding: 8px 12px;
  animation: toastin .3s ease-out;
}
.toast.out { opacity: 0; transform: translateX(30px); transition: all .4s; }
@keyframes toastin { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; } }
.toast img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.toast .tname { color: #fff; }
.toast .trate { font-size: 15px; color: var(--dim); }
.toast.rare { border-color: var(--purple); box-shadow: 0 0 16px rgba(180,76,255,.55); }
.toast.rare .tname { color: var(--purple); }
.toast.pet { border-color: var(--green); box-shadow: 0 0 16px rgba(53,184,57,.5); }
.toast.pet .tname { color: var(--green); }
/* Purchases keep the default gold border — it's already the money colour —
   and only tint the name, so a buy reads as a quieter cousin of a drop. */
.toast.buy { box-shadow: 0 0 16px rgba(255,152,31,.4); }
.toast.buy .tname { color: var(--gold); }

/* --------------------------------------------------------------- shake --- */
body.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(3px, 2px); }
}

/* --------------------------------------------------------------- modal --- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 3px solid var(--gold);
  box-shadow: 0 0 40px rgba(0,0,0,.8);
  max-width: 480px; width: 92%;
  padding: 20px;
  max-height: 80vh; overflow-y: auto;
}
.modal-box h2 { color: var(--gold); font-size: 26px; margin-bottom: 10px; text-shadow: 2px 2px 0 #000; }
.away-drops { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.away-drop { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--edge); padding: 4px 8px; }
.away-drop img { width: 30px; height: 30px; object-fit: contain; }
.away-drop .qty { margin-left: auto; color: var(--gold); }

/* --------------------------------------------------------------- login --- */
.login-wrap { max-width: 760px; margin: 60px auto; padding: 0 16px; }
.login-title { text-align: center; font-size: 44px; color: var(--gold); text-shadow: 3px 3px 0 #000; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--dim); margin-bottom: 28px; }
.login-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .login-cols { grid-template-columns: 1fr; } }
.login-cols form { display: flex; flex-direction: column; gap: 10px; }
.err { color: #ff6b5e; min-height: 22px; }

/* ------------------------------------------------------ collection log --- */
.cl-wrap { max-width: 1100px; margin: 0 auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.cl-boss { }
.cl-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2);
  border-bottom: 2px solid var(--edge);
  padding: 6px 10px; margin-bottom: 8px;
}
.cl-head img { width: 34px; height: 34px; object-fit: contain; }
.cl-head .cl-title { font-size: 22px; color: var(--gold); }
.cl-head .cl-count { margin-left: auto; color: var(--dim); }
.cl-boss.complete .cl-title { color: var(--green); }
.cl-boss.complete .cl-head { border-color: var(--green); }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.cl-cell {
  position: relative;
  background: #2c261d;
  border: 2px solid var(--edge);
  aspect-ratio: 1; padding: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cl-cell img { max-height: 44px; filter: grayscale(1) brightness(0.45); }
.cl-cell.owned { border-color: var(--gold); }
.cl-cell.owned img { filter: none; }
.cl-cell .qty {
  position: absolute; top: 1px; right: 3px;
  font-size: 14px; color: #ffff00; text-shadow: 1px 1px 0 #000;
}

/* --------------------------------------------------------- leaderboard --- */
.board-wrap { max-width: 900px; margin: 0 auto; padding: 14px; }
table.board { width: 100%; border-collapse: collapse; }
table.board th, table.board td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--edge); }
table.board th { background: var(--panel2); color: var(--gold); cursor: pointer; user-select: none; }
table.board th:hover { color: #fff; }
table.board th .arrow { font-size: 14px; }
table.board tr:hover td { background: rgba(255,152,31,.06); }
table.board td.num { color: var(--gold); }
.board-note { color: var(--dim); margin-top: 8px; font-size: 16px; }

/* --------------------------------------------------------------- pick --- */
.nothing { text-align: center; color: var(--dim); padding: 60px 0; font-size: 24px; }

/* -------------------------------------------------------- quests & notes --- */
.toast.quest { border-color: #e8c04a; box-shadow: 0 0 16px rgba(232,192,74,.55); }
.toast.quest .tname { color: #e8c04a; }
#chat-inner .line.quest { color: #e8c04a; }
.quests-wrap, .notes-wrap { max-width: 900px; margin: 0 auto; padding: 14px; }
.quests-note { color: var(--dim); margin-bottom: 12px; }
.q-card {
  background: var(--panel2); border: 2px solid var(--edge);
  padding: 10px 12px; margin-bottom: 12px;
}
.q-card.ready { border-color: #e8c04a; box-shadow: 0 0 12px rgba(232,192,74,.35); }
.q-card.completed { opacity: .75; border-color: var(--green); }
.q-card.locked { opacity: .6; }
.q-head { display: flex; justify-content: space-between; align-items: baseline; }
.q-name { font-size: 22px; color: var(--gold); }
.q-state { color: var(--dim); font-size: 16px; }
.q-card.ready .q-state { color: #e8c04a; }
.q-card.completed .q-state { color: var(--green); }
.q-flavor { color: var(--parchment); font-style: italic; margin: 4px 0 8px; }
.q-lvl { color: #ff6b5e; font-size: 16px; margin-bottom: 6px; }
.q-lvl.done { color: var(--green); }
.q-req { margin: 6px 0; }
.q-req-label { font-size: 16px; }
.q-req.done .q-req-label { color: var(--green); }
.q-bar { height: 10px; background: #241f17; border: 1px solid var(--edge); }
.q-bar div { height: 100%; background: linear-gradient(#ffb051, var(--gold)); }
.q-req.done .q-bar div { background: linear-gradient(#4fd151, #2f9e33); }
.q-rewards { color: var(--dim); font-size: 16px; margin-top: 6px; }
.q-btn { margin-top: 8px; }
.q-btn.ready { border-color: #e8c04a; color: #e8c04a; animation: fightpulse 1.6s ease-in-out infinite; }

/* -------------------------------------------------------------- farming --- */
.farm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.farm-patch {
  background: var(--panel2); border: 2px solid var(--edge);
  padding: 10px 12px; text-align: center;
}
.farm-patch.empty { opacity: .7; border-style: dashed; }
/* Ghost plot: visibly present but plainly not yours yet — fainter than an
   empty plot, and with no button, so it reads as "coming later" rather than
   "something you failed to use". */
.farm-patch.locked {
  opacity: .38; border-style: dashed; background: transparent;
  padding-bottom: 12px;
}
.farm-patch.locked .fp-body { margin-bottom: 0; font-style: italic; }
.farm-patch.ready { border-color: #e8c04a; box-shadow: 0 0 12px rgba(232,192,74,.35); }
.fp-head { color: var(--dim); font-size: 16px; margin-bottom: 4px; }
.fp-body { margin-bottom: 8px; }
.fp-body.ready { color: #e8c04a; }
.fp-btn { width: 100%; }
.fp-btn.ready { border-color: #e8c04a; color: #e8c04a; animation: fightpulse 1.6s ease-in-out infinite; }
.fp-seed { display: block; width: 100%; text-align: left; margin-bottom: 6px; }
.fp-bonus-tag { color: #e8c04a; font-size: 13px; margin-left: 4px; }

.note { margin-bottom: 16px; }
.note-head { font-size: 24px; color: var(--gold); border-bottom: 1px solid var(--edge); margin-bottom: 6px; }
.note-date { color: var(--dim); font-size: 16px; margin-left: 8px; }
.note ul { margin-left: 22px; line-height: 1.45; }

/* --------------------------------------------------------- board & misc --- */
.board-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.board-tabs button.on { border-color: var(--gold); color: var(--gold); background: #55461f; }
.cl-master { color: var(--green); font-size: 15px; margin-left: 10px; }
.site-footer {
  text-align: center; color: var(--dim); font-size: 15px;
  padding: 14px 0 18px; opacity: .8;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------- v1.2: notifications --- */
#notif-stack {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 150; display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 20px));
  pointer-events: none;
}
.notif-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(#4a4034, #322b20);
  border: 2px solid #e8c04a;
  box-shadow: 0 6px 24px rgba(0,0,0,.7), 0 0 18px rgba(232,192,74,.35);
  padding: 10px 14px;
  animation: nbin .35s ease-out;
}
.notif-banner.out { opacity: 0; transform: translateY(-16px); transition: all .45s; }
@keyframes nbin { from { opacity: 0; transform: translateY(-22px) scale(.96); } to { opacity: 1; } }
.notif-banner img { width: 40px; height: 40px; object-fit: contain; }
.nb-title { color: #e8c04a; font-size: 20px; text-shadow: 1px 1px 0 #000; }
.nb-body { color: var(--parchment); font-size: 16px; }

/* ------------------------------------------------------- v1.2: economy --- */
.qmark {
  width: 22px; height: 22px; padding: 0; margin-left: 4px;
  border-radius: 50%; font-size: 14px; line-height: 1;
  color: var(--dim); border-color: var(--edge);
  vertical-align: middle;
}
.store-head { margin-top: 16px; }
#gp-line { font-size: 20px; margin: 4px 0; }
#gp-line b { color: #ffd700; }
.boost-line { color: var(--parchment); padding: 2px 0; }
.boost-timer { color: var(--gold); margin-left: 6px; }
#store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
#store-upgrades-gp, #store-upgrades-plat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pg-sub { color: var(--dim); font-size: 15px; margin: 10px 0 0; text-transform: uppercase; letter-spacing: 0.04em; }
.upg-pips { display: flex; justify-content: center; gap: 4px; margin: 4px 0; }
.upg-pip { width: 10px; height: 10px; border: 1px solid var(--edge); border-radius: 2px; }
.upg-pip.on { background: var(--gold); border-color: var(--gold); }
.upg-now { color: var(--parchment); font-size: 14px; margin-bottom: 6px; }
.pot-card { background: #2c261d; border: 2px solid var(--edge); padding: 8px; text-align: center; }
.pot-icon { width: 36px; height: 36px; object-fit: contain; display: block; margin: 0 auto 4px; }
.tok-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.pot-name { color: var(--gold); line-height: 1.1; }
.pot-fx { font-size: 14px; color: var(--dim); margin: 4px 0 6px; }
.pot-buy { width: 100%; padding: 8px 2px; }
.bank-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
  border-bottom: 2px solid var(--edge); padding-bottom: 8px;
}
.bank-tabs { display: flex; gap: 8px; }
.bank-tabs button { padding: 8px 16px; font-size: 18px; }
.bank-tabs button.on { border-color: var(--gold); color: var(--gold); background: #55461f; }
#gp-line { font-size: 22px; }
#gp-line b { color: #ffd700; }
#bank-hint { margin-bottom: 10px; }
.inv-item { grid-template-rows: auto auto auto auto; }
.ii-sell { font-size: 14px; color: #ffd700; grid-column: 2; }
.dupes-tag { color: #ffd700; }
.ii-sellbtn {
  grid-column: 1 / -1;
  margin-top: 6px; padding: 8px 4px; font-size: 15px;
  border-color: #8a7430; color: #ffd700; background: #3a3220;
}
.ii-sellbtn:hover { border-color: #ffd700; }
#sell-mode.on { border-color: #ffd700; color: #ffd700; background: #55461f; }
.inv-item.tagged { border-color: #ffd700; box-shadow: 0 0 10px rgba(255,215,0,.35); }
.inv-item.tagged-last { border-color: var(--red); box-shadow: 0 0 10px rgba(192,35,22,.45); }
.tag-badge {
  grid-column: 1 / -1;
  font-size: 13px; letter-spacing: 1px;
  color: #ffd700; text-shadow: 1px 1px 0 #000;
}
.inv-item.tagged-last .tag-badge { color: #ff8b7e; }
#sell-bar {
  position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 85;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(#4a4034, #322b20);
  border: 2px solid #ffd700;
  box-shadow: 0 6px 24px rgba(0,0,0,.7);
  padding: 10px 16px;
  max-width: 640px; margin: 0 auto;
}
#sell-bar-info { flex: 1; font-size: 18px; }
#sell-bar-info b { color: #ffd700; }
#sell-bar-go { border-color: #ffd700; color: #ffd700; padding: 8px 22px; font-size: 18px; }
#sell-bar-go:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) {
  #sell-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
#bank-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#bank-toolbar select {
  font-family: inherit; font-size: 16px; padding: 8px;
  background: #241f17; color: var(--parchment); border: 2px solid var(--edge);
  flex: 1; min-width: 120px;
}
#bank-toolbar button { flex: 1; min-width: 130px; }
.inv-item { min-height: 52px; }
.inv-item.ghost { opacity: .45; }
.inv-item.ghost img { filter: grayscale(1) brightness(.6); }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.sheet-head img { width: 52px; height: 52px; object-fit: contain; }
.sheet-name { font-size: 24px; color: var(--gold); }
.sheet-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin-bottom: 12px; }
.sheet-rows div:nth-child(odd) { color: var(--dim); }
.sheet-btn { display: block; width: 100%; margin-top: 8px; padding: 11px 0; font-size: 18px; }
.sheet-btn.warn { border-color: var(--red); color: #ff8b7e; }
/* Exact-quantity sell control: produce and forge materials only. */
.sell-qty { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--dim); }
.sell-qty input { width: 90px; text-align: right; }

/* ------------------------------------------------------- v1.2: account --- */
.account-wrap { max-width: 900px; margin: 0 auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.account-wrap .stat-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dotted var(--edge); }
.account-wrap .stat-line b { color: var(--gold); font-weight: normal; text-align: right; }
.nf-row { display: block; padding: 6px 0; font-size: 18px; }
.nf-row input[type=checkbox] { width: 18px; height: 18px; }
#nf-save { margin-top: 8px; margin-right: 10px; }
#pw-form { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }

/* --------------------------------------------------------- v1.2: guide --- */
.guide h3 { color: var(--gold); margin: 14px 0 4px; font-size: 21px; }
.guide p { line-height: 1.5; margin-bottom: 6px; }
.guide .g-code {
  background: #241f17; border: 1px solid var(--edge);
  padding: 8px 12px; font-size: 16px; color: #b6aaff;
  overflow-x: auto;
}
.site-footer a { color: var(--dim); text-decoration: underline; }
.site-footer a:hover { color: var(--gold); }

/* -------------------------------------------------------------- mobile --- */
a, button, .boss-row, .cl-cell, .inv-item, .slot-cell { touch-action: manipulation; }
#mobile-tabs { display: none; }
#touch-tip {
  display: none; position: fixed; z-index: 200;
  transform: translateY(-100%);
  background: #241f17; color: var(--parchment);
  border: 2px solid var(--gold);
  padding: 6px 10px; font-size: 16px; line-height: 1.25;
  box-shadow: 0 4px 14px rgba(0,0,0,.6);
  pointer-events: none;
}

@media (max-width: 700px) {
  /* Compact sticky header; nav moves to the bottom tab bar. */
  .topbar { position: sticky; top: 0; z-index: 60; gap: 10px; padding: 7px 12px; }
  .topbar nav { display: none; }
  .logo { font-size: 20px; white-space: nowrap; }
  .userbox { gap: 8px; font-size: 15px; }
  .userbox #who { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .userbox button { padding: 6px 10px; font-size: 15px; }

  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  #mobile-tabs {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: linear-gradient(#4a4034, #322b20);
    border-top: 3px solid var(--edge-dark);
    box-shadow: 0 1px 0 var(--edge) inset;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #mobile-tabs a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 7px; color: var(--dim); text-decoration: none;
  }
  #mobile-tabs a.here { color: var(--gold); background: rgba(255, 152, 31, 0.09); }
  #mobile-tabs a:active { background: rgba(255, 152, 31, 0.16); }
  .mt-ico { font-size: 19px; line-height: 1; }
  .mt-label { font-size: 12px; letter-spacing: 0.5px; }

  /* Game screen: arena first, stats second, monster list last. */
  .game-layout { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  #stage { order: 0; }
  #stats { order: 1; }
  #boss-list { order: 2; max-height: 340px; }
  #arena { height: 280px; }
  #boss-img { max-height: 185px; max-width: 82vw; }
  #boss-shadow { width: 140px; margin-left: -70px; bottom: 20px; }
  #hpbar { width: min(240px, 68vw); }
  #boss-title { font-size: 24px; }
  #fight-btn { font-size: 23px; padding: 10px 20px; }
  #fight-info { font-size: 15px; }
  #flee-btn { padding: 6px 12px; }
  .hitsplat { width: 38px; height: 38px; font-size: 22px; }
  .xp-float { font-size: 19px; }
  .boss-row { padding: 9px 8px; }
  .boss-row .block { max-width: 105px; font-size: 13px; }
  #train-styles button { padding: 9px 2px; }
  /* Phones: the feed sits under the KC bar in the single-column stack. The
   * height is inherited from the line-count rule, so shrinking the type here
   * makes the panel shorter rather than showing more messages than desktop. */
  #chat-inner { font-size: 16px; }

  /* Toasts: full-width strip floating above the tab bar. */
  #toasts {
    left: 10px; right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    align-items: stretch;
  }
  .toast { min-width: 0; max-width: none; }

  /* Other pages */
  .equip-layout, .quests-wrap, .notes-wrap, .board-wrap { padding: 10px; gap: 10px; }
  .cl-wrap { padding: 10px; gap: 10px; }
  .cl-grid { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .cl-head .cl-master { display: block; margin-left: 0; }
  #slots-grid { gap: 6px; }
  .inv-items { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .q-btn { width: 100%; padding: 11px 0; font-size: 19px; }
  table.board { min-width: 540px; }
  table.board th, table.board td { padding: 8px 8px; font-size: 17px; }
  .board-tabs button { flex: 1; padding: 9px 4px; }
  .login-wrap { margin: 24px auto; }
  .modal-box { max-height: 76vh; }
}
.hidden { display: none !important; }
.dim-note { color: var(--dim); font-size: 16px; }

/* -------------------------------------------------------------- combat --- */
#boss-img.dying {
  animation: die 0.42s ease-in forwards;
}
@keyframes die {
  0%   { transform: none; filter: none; opacity: 1; }
  40%  { transform: rotate(7deg) translateY(6px); filter: grayscale(.6) brightness(1.6); }
  100% { transform: rotate(14deg) translateY(22px) scale(0.92); filter: grayscale(1) brightness(0.4); opacity: 0.05; }
}
#boss-img.spawn { animation: spawnin 0.35s ease-out; }
@keyframes spawnin {
  0%   { transform: scale(0.75); opacity: 0; filter: brightness(2); }
  100% { transform: scale(1); opacity: 1; filter: none; }
}
#arena.under-attack::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: 0 0 60px 18px rgba(192, 35, 22, 0.55) inset;
  animation: vignette 0.45s ease-out forwards;
}
@keyframes vignette { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
#arena.under-attack #boss-wrap { animation: bob 2.2s ease-in-out infinite, jab 0.25s ease-out; }
@keyframes jab { 40% { margin-top: 10px; } }

#hpbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 20px; z-index: 5;
  background: #7e150c;
  border: 2px solid #000;
  box-shadow: 0 2px 6px rgba(0,0,0,.6);
}
#hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(#4fd151, #2f9e33);
}
/* Same OSRS health-bar look as #hpbar — red "damage taken" showing through
 * a shrinking green fill — just inline in the sidebar instead of floating
 * over the arena, and with no centered label (the number lives next to it
 * in its own stat-line already). */
.mini-hpbar {
  width: 100%; height: 12px; margin: 2px 0 8px;
  background: #7e150c;
  border: 2px solid #000;
}
.mini-hpbar > div {
  height: 100%; width: 100%;
  background: linear-gradient(#4fd151, #2f9e33);
  transition: width 0.4s ease-out;
}
.mini-hpbar.warn > div { background: linear-gradient(#ffcf4d, #d69b1f); }
.mini-hpbar.danger > div { background: linear-gradient(#ff6b5e, #c02316); }
#hpbar span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; text-shadow: 1px 1px 0 #000;
}

#fight-overlay {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 28px; gap: 10px;
  background: linear-gradient(rgba(20,16,10,0), rgba(20,16,10,.55) 75%);
}
#fight-btn {
  font-size: 28px; padding: 10px 30px;
  background: linear-gradient(#5d4f2e, #443a22);
  border: 3px solid var(--gold);
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  box-shadow: 0 4px 16px rgba(0,0,0,.6), 0 0 18px rgba(255,152,31,.25);
  animation: fightpulse 1.6s ease-in-out infinite;
}
#fight-btn:hover:not(:disabled) { color: #fff; border-color: #fff; }
#fight-btn:disabled { animation: none; opacity: .65; cursor: not-allowed; border-color: var(--edge); color: var(--dim); }
@keyframes fightpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
#fight-info { font-size: 17px; color: var(--parchment); text-shadow: 1px 1px 0 #000; text-align: center; padding: 0 12px; }

#flee-btn {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  font-size: 15px; padding: 3px 10px;
  opacity: .75;
}
#flee-btn:hover { opacity: 1; }

#pet-img {
  position: absolute; bottom: 30px; left: 26px; z-index: 2;
  width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6));
  animation: bob 1.8s ease-in-out infinite;
}
/* The token-shop Golden chick reuses the starter chick's art, tinted —
 * token-exclusive, never earned any other way, so it should read as
 * visibly distinct from both the starter and any boss pet. */
#pet-img.pet-golden {
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)) sepia(1) saturate(6) hue-rotate(-10deg) brightness(1.15);
}
/* The companion's drop — click it within its window or it's gone. The
 * pulse plus a visible squeeze on the last couple seconds is the only
 * "hurry up" signal; there is no numeric countdown to keep it readable
 * at a glance. */
#pet-drop {
  position: absolute; z-index: 3;
  width: 44px; height: 44px; padding: 4px;
  background: none; border: none;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.7)) drop-shadow(0 0 10px rgba(255, 176, 58, .85));
  animation: dropPulse 0.9s ease-in-out infinite;
  transition: left 0.4s ease-out, bottom 0.4s ease-out;
}
#pet-drop img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
#pet-drop:hover { transform: scale(1.1); }
@keyframes dropPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(255, 176, 58, .8); }
  50% { transform: scale(1.15); box-shadow: 0 0 22px rgba(255, 176, 58, 1); }
}

.boss-row.fighting .bname { color: var(--gold); }
.boss-row .swords { font-size: 14px; }
.pg-head { margin-top: 10px; color: var(--dim); font-size: 16px; border-bottom: 1px solid var(--edge); }

/* -------------------------------------------------------------- skills --- */
.hitsplat.miss { background: #3c58b0; box-shadow: 0 0 0 2px #24356e inset, 2px 2px 4px rgba(0,0,0,.5); }
.skill-line { display: flex; justify-content: space-between; padding: 4px 0 2px; }
.skill-line b { color: var(--gold); font-weight: normal; font-size: 21px; }
.xpbar {
  position: relative; height: 14px; margin-bottom: 6px;
  background: #241f17; border: 1px solid var(--edge);
}
.xpbar div { height: 100%; width: 0%; background: linear-gradient(#8a7bff, #5b48d6); }
.xpbar span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #000; letter-spacing: 0;
}
#train-styles { display: flex; gap: 6px; margin: 6px 0; }
#train-styles button { flex: 1; font-size: 15px; padding: 4px 2px; }
#train-styles button.on { border-color: var(--gold); color: var(--gold); background: #55461f; }
.xp-float {
  position: absolute; left: 50%; top: 34%; z-index: 7;
  transform: translateX(-50%);
  color: #b6aaff; font-size: 22px; text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  animation: xpfloat 1.4s ease-out forwards;
}
@keyframes xpfloat {
  0%   { opacity: 0; margin-top: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; margin-top: -70px; }
}

/* ----------------------------------------------------------- equipment --- */
.equip-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  padding: 14px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) { .equip-layout { grid-template-columns: 1fr; } }
#slots-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.slot-cell {
  background: #2c261d;
  border: 2px solid var(--edge);
  min-height: 96px;
  padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; text-align: center;
}
.slot-cell.filled { border-color: var(--gold); cursor: pointer; }
.slot-cell.filled:hover { border-color: #fff; }
.slot-cell .slot-name { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.slot-cell img { width: 34px; height: 34px; object-fit: contain; }
.slot-cell .slot-item { font-size: 14px; line-height: 1.05; color: var(--parchment); }
.slot-cell .slot-pow { font-size: 13px; color: var(--gold); }
.slot-cell .slot-empty { color: #57503f; margin-top: 16px; }
#equip-summary { margin-top: 12px; line-height: 1.45; border-top: 1px solid var(--edge); padding-top: 10px; }
#equip-summary b { color: var(--gold); font-weight: normal; }
.bank-note { color: var(--dim); font-size: 16px; margin-bottom: 10px; }
.inv-group { margin-bottom: 14px; }
.inv-head { color: var(--gold); border-bottom: 1px solid var(--edge); margin-bottom: 6px; text-transform: uppercase; font-size: 15px; letter-spacing: 1px; }
.inv-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.inv-item {
  display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 8px;
  align-items: center;
  background: #2c261d; border: 2px solid var(--edge);
  padding: 6px 8px; cursor: pointer;
}
.inv-item img { grid-row: span 2; width: 34px; height: 34px; object-fit: contain; }
.inv-item:hover { border-color: var(--gold); }
.inv-item.equipped { border-color: var(--green); cursor: default; }
.inv-item .ii-name { font-size: 15px; line-height: 1.05; }
.inv-item .ii-pow { font-size: 13px; color: var(--dim); }
.inv-item .eqtag { color: var(--green); }

/* ------------------------------------------------- v1.2.4: clarity & UX --- */
/* Skeleton: never show fake level-1 zeros before the first payload lands. */
body.loading #stats .stat-line b,
body.loading .skill-line b { color: var(--dim); opacity: .5; }
body.loading #boss-rows { opacity: .35; }
.bank-nudge { color: #ffd700; font-size: 15px; }
.style-proj { display: block; font-size: 12px; color: var(--dim); letter-spacing: 0; }
#train-styles button.on .style-proj { color: var(--gold); }
.away-upgrades {
  margin-top: 10px; padding: 8px 10px;
  background: #55461f; border: 2px solid var(--gold);
  line-height: 1.4;
}
.away-gear-link { font-size: 17px; }
.ui-dialog .modal-box { max-width: 420px; }
.ui-dialog-body { line-height: 1.45; margin-bottom: 14px; }
.ui-dialog-btns { display: flex; gap: 10px; }
.ui-dialog-btns button { flex: 1; padding: 10px 0; font-size: 18px; }
.ui-dialog-btns .ui-ok { border-color: var(--gold); color: var(--gold); }
.ui-dialog-btns .ui-ok.warn { border-color: var(--red); color: #ff8b7e; }
.up-dot { color: #ffd700; font-size: 12px; vertical-align: super; margin-left: 3px; animation: fightpulse 2s ease-in-out infinite; }
#mobile-tabs .up-dot { position: absolute; margin-left: 16px; margin-top: -2px; }
#mobile-tabs a { position: relative; }

/* Staging test-server banner — impossible to mistake for live. */
#staging-badge {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 300; pointer-events: none;
  background: #7e150c; color: #ffd0c9; border: 2px solid #ff6b5e; border-top: none;
  padding: 2px 14px 3px; font-size: 15px; letter-spacing: 1px;
}

/* ---------------------------------------------- v1.3.0: attack types & forge */
.weak-tag { margin-left: 6px; font-size: 14px; letter-spacing: 1px; }
#train-styles { display: flex; gap: 6px; flex-wrap: wrap; }
#train-styles button { min-width: 30%; }
.lanes span { margin-right: 8px; white-space: nowrap; }
.lane-weak { color: #7fd47f; }
.lane-normal { color: var(--dim); }
.lane-stiff { color: #e07070; }

#forge-slots { display: flex; gap: 10px; margin: 10px 0; }
.forge-slot {
  flex: 1; min-height: 84px; border: 2px dashed var(--dim); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px; color: var(--dim); font-size: 15px;
}
.forge-slot.filled { border-style: solid; border-color: var(--gold); color: var(--parchment); cursor: pointer; }
.forge-slot img { width: 40px; height: 40px; object-fit: contain; }
.fs-name { font-size: 14px; text-align: center; }
#forge-actions { display: flex; gap: 8px; margin-bottom: 8px; }
#forge-go { background: #55461f; border-color: var(--gold); color: var(--gold); }
#forge-go:disabled { opacity: 0.5; }
#forge-result { padding: 8px 10px; border-radius: 6px; margin-bottom: 8px; background: var(--panel2); }
#forge-result.forge-ok { border-left: 3px solid #7fd47f; }
#forge-result.forge-hint { border-left: 3px solid var(--gold); }
#forge-result.forge-cold { border-left: 3px solid var(--dim); color: var(--dim); }
#forge-picker { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; overflow-y: auto; }
.forge-pick { position: relative; width: 44px; height: 44px; padding: 2px; }
.forge-pick img { width: 100%; height: 100%; object-fit: contain; }
.forge-pick.on { border-color: var(--gold); background: #55461f; }
.forge-pick.mat { border-color: #8a6ad4; }
.fp-qty {
  position: absolute; right: 1px; bottom: 0; font-size: 12px; color: var(--gold);
  text-shadow: 1px 1px 0 #000;
}
.recipe-card {
  display: flex; align-items: center; gap: 10px; background: var(--panel2);
  border-radius: 6px; padding: 8px; margin-top: 8px;
}
.recipe-card img { width: 40px; height: 40px; object-fit: contain; }
.rc-body { flex: 1; }
.rc-name { font-size: 17px; }
.rc-parts { font-size: 14px; }
.rc-parts .ok { color: #7fd47f; }
.rc-parts .missing { color: #e07070; }
.rumor-card { background: var(--panel2); border-radius: 6px; padding: 8px 10px; margin-top: 8px; color: var(--dim); }

/* ------------------------------------------------- v1.3.1: bank/forge cleanup */
.inv-count { color: var(--dim); font-size: 13px; letter-spacing: 0; text-transform: none; }
#forge-search {
  width: 100%; margin-bottom: 8px; padding: 6px 10px; font-size: 16px;
  background: var(--panel2); border: 1px solid var(--edge); border-radius: 6px;
}
.forge-pick {
  width: 72px; height: 72px; padding: 3px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.forge-pick img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.fp-name {
  font-size: 11px; line-height: 1.1; color: var(--dim); max-width: 100%;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  text-align: center; letter-spacing: 0;
}
.forge-pick.on .fp-name { color: var(--gold); }

/* --------------------------------------------- v1.3.1: compact bank rework */
.bank-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bank-card {
  position: relative; width: 104px; padding: 8px 4px 6px;
  background: var(--panel2); border: 1px solid var(--edge); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; text-align: center;
}
.bank-card:hover { border-color: var(--gold); }
.bank-card img { width: 36px; height: 36px; object-fit: contain; }
.bank-card.equipped { border-color: var(--gold); background: #4a3f22; }
.bank-card.ghost { opacity: .45; }
.bank-card.ghost img { filter: grayscale(1) brightness(.6); }
.bank-card.tagged { border-color: #c25b5b; }
.bank-card.tagged-last { border-color: #e03d3d; background: #4a2424; }
.bc-name {
  font-size: 13px; line-height: 1.15; max-width: 100%; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bc-sub { font-size: 12px; color: var(--dim); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bc-qty {
  position: absolute; top: 2px; right: 4px; font-size: 12px; color: var(--gold);
  text-shadow: 1px 1px 0 #000;
}
.bc-worn { position: absolute; top: 2px; left: 4px; font-size: 13px; color: var(--gold); }
.bank-card .tag-badge {
  position: absolute; top: 22px; left: 0; right: 0; font-size: 11px;
  background: #e03d3dcc; color: #fff; padding: 1px 0; letter-spacing: 1px;
}
#item-sheet .modal-box { max-width: 440px; width: min(440px, 92vw); }
#item-sheet .sheet-head img { width: 64px; height: 64px; }
.sheet-worn { color: var(--gold); font-size: 14px; }

/* -------------------------------------- v1.3.1: docked item panel (no popup) */
.equip-layout { grid-template-columns: 340px 1fr 330px; }
@media (max-width: 1200px) { .equip-layout { grid-template-columns: 280px 1fr 300px; } }
#item-panel { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
.ip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ip-head h2 { margin-bottom: 0; }
#ip-close { padding: 2px 10px; }
.bank-card.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }
#item-panel .sheet-btn { display: block; width: 100%; margin-top: 6px; }
@media (max-width: 900px) {
  /* HOTFIX v2.0.1: this appended block comes LATER in the cascade than the
   * original 900px single-column rule, so the 1200px three-column rule was
   * winning on phones and forcing ~580px of fixed columns onto a 375px
   * screen — the whole gear tab overflowed sideways. Single column must be
   * re-declared HERE, after the 1200px override. */
  .equip-layout { grid-template-columns: 1fr; }
  /* Phones: the panel is a bottom drawer that slides up on selection. */
  #item-panel {
    display: none; position: fixed; left: 8px; right: 8px;
    bottom: calc(66px + env(safe-area-inset-bottom)); top: auto;
    max-height: 60vh; overflow-y: auto; z-index: 60; margin: 0;
    box-shadow: 0 -6px 24px #000c; border: 1px solid var(--edge);
  }
  #item-panel.open { display: block; }
  /* Finger-sized close target for the drawer. */
  #ip-close { padding: 8px 16px; font-size: 18px; }
}

/* --------------------------------------------- v1.3.1: two-part forge rework */
#forge-slots { align-items: stretch; }
.forge-op { align-self: center; font-size: 26px; color: var(--dim); flex: none; padding: 0 2px; }
.forge-slot.result { border-style: solid; border-color: var(--edge); font-size: 30px; color: var(--dim); }
.forge-slot.result.known { border-color: var(--gold); color: var(--parchment); font-size: 15px; }
.forge-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.fp-bar { flex: 1; height: 10px; background: #221d15; border-radius: 5px; overflow: hidden; border: 1px solid var(--edge); }
.fp-bar div { height: 100%; background: var(--gold); }
.forge-progress span { color: var(--dim); font-size: 14px; white-space: nowrap; }
.rumor-card { display: flex; align-items: center; gap: 12px; }
.rum-pair { display: flex; align-items: center; gap: 6px; flex: none; }
.rum-pair img { width: 30px; height: 30px; object-fit: contain; }
.rum-q {
  width: 30px; height: 30px; border: 1px dashed var(--dim); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.forge-undisc { margin-top: 10px; }

/* v1.3.1: per-type accuracy strip on the item card */
.att-strip span { margin-right: 8px; white-space: nowrap; color: var(--dim); }
.att-strip .as-best { color: var(--gold); }
.att-strip .as-zero { opacity: .4; }

/* ---------------------------------------------- v1.3.1: themed SVG icons */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: currentColor; }
.ic-dim { color: var(--dim); }
.bank-tabs button .ic, #forge-go .ic { margin-right: 4px; }
#mobile-tabs a .ic { width: 20px; height: 20px; display: block; margin: 0 auto 2px; }
.att-strip .ic, .style-proj + .ic { vertical-align: -0.1em; }
#train-styles button .ic { margin-right: 2px; }
.weak-tag .ic { width: 0.85em; height: 0.85em; margin-left: 2px; color: #7fd47f; }
.bc-worn .ic, .sheet-worn .ic { color: var(--gold); }
.logo .ic-logo { color: var(--gold); width: 22px; height: 22px; vertical-align: -0.2em; }
.inv-head .ic { width: 0.9em; height: 0.9em; }

/* ----------------------------------------------------------- v2.0.2 hotfix */
/* Any content wider than the screen used to widen iOS Safari's layout
 * viewport, un-anchoring position:fixed bars (mobile tab bar drifting on the
 * Shop pane et al). Clip the axis at the root so no pane can ever do that. */
html, body { overflow-x: hidden; overflow-x: clip; }
.bank-tabs { flex-wrap: wrap; }
.pot-card, .forge-slot { min-width: 0; }
.fs-name, .rc-parts, .pot-name { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .bank-tabs button { padding: 8px 10px; font-size: 17px; }
}

/* ------------------------------------------------------- v2.2.0: chat --- */
/* The type-here strip: part of the same frame, never scrolls away. */
#chat-form {
  display: flex; gap: 6px; flex: none;
  padding: 6px; border-top: 2px solid var(--edge);
  background: #272219;
}
#chat-input {
  flex: 1; font-size: 17px; padding: 5px 9px;
  background: #1d1913; border-width: 1px;
}
#chat-send { flex: none; padding: 5px 14px; font-size: 16px; }
/* Server announcements: the rarest thing in the game, so they read like an
 * event rather than a line of talk. No name, no crown, nothing clickable. */
#chat-inner .line.announce {
  color: var(--gold);
  background: rgba(255, 152, 31, .09);
  border-left: 3px solid var(--gold);
  padding: 2px 6px;
  margin: 3px 0;
}
.chat-time { color: var(--dim); font-size: 14px; margin-right: 6px; }
#chat-inner .line.said { color: var(--parchment); }
#chat-inner .line.said .who { color: #7fd0ff; }
#chat-inner .line.said.mine .who { color: var(--gold); }
#chat-inner .line.said .who.modable { cursor: pointer; text-decoration: underline dotted; }
#chat-inner .line.said .who.modable:hover { color: var(--red); }
.ui-input { margin-bottom: 10px; }

/* --------------------------------------------- v2.3.0: staff crowns --- */
/* A crown's colour is its meaning, so these two opt out of currentColor. */
.crown { display: inline-flex; margin-right: 4px; vertical-align: -0.1em; }
.crown .ic { width: 0.95em; height: 0.95em; }
.crown-admin .ic { fill: #ffd200; filter: drop-shadow(0 0 2px rgba(255,210,0,.5)); }
.crown-mod .ic { fill: #d9dde3; filter: drop-shadow(0 0 2px rgba(217,221,227,.4)); }
#chat-clear { flex: none; padding: 5px 12px; font-size: 16px; border-color: var(--red); color: #ff8b7e; }
.ui-choices { display: flex; flex-direction: column; gap: 2px; }

/* ------------------------------------------- v2.15.0: equipment page polish */
/* Clearer hierarchy on the gear page: titled panels with a one-line purpose,
 * a paper doll, search + category chips on the bank, and a details panel whose
 * actions say what they do. Scoped to this page so the rest of the site keeps
 * its look. */
body[data-page="equip"] {
  --card: #2f291f;
  --card-hi: #3a3226;
  --radius: 8px;
  --gold-soft: rgba(255, 152, 31, .12);
  --sell: #e8c04a;
}
.equip-layout { gap: 16px; padding: 16px; }
.equip-layout .panel {
  border-radius: 10px; padding: 14px 16px;
  background: linear-gradient(#433a2d, #3a3226 160px);
  box-shadow: 0 0 0 1px var(--edge) inset, 0 4px 16px rgba(0,0,0,.35);
}
.equip-layout button { border-radius: 6px; }
.equip-layout .qmark { border-radius: 50%; }
.equip-layout select, .equip-layout input { border-radius: 6px; }

/* Panel headers: icon, title, one line saying what the panel is for. */
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph-ico .ic { width: 30px; height: 30px; color: var(--gold); display: block; }
.ph-text h2 { margin-bottom: 0; font-size: 25px; line-height: 1; color: #f2e6cc; }
.ph-sub { color: var(--dim); font-size: 16px; line-height: 1.2; margin-top: 2px; }
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 2px 0 10px;
}
.pane-head .ph-text { min-width: 0; }

/* Tabs + gp: the page's top-level switch, sized like one. */
.bank-head { border-bottom: 1px solid var(--edge); padding-bottom: 12px; margin-bottom: 12px; }
.bank-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-size: 20px; justify-content: center;
  background: var(--card); border-color: var(--edge);
}
.bank-tabs button.on {
  background: linear-gradient(#6a5424, #4f3f1d);
  border-color: var(--gold); color: #ffcf6a;
  box-shadow: 0 0 0 1px rgba(255,152,31,.35), 0 0 12px rgba(255,152,31,.18);
}
#gp-line {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 24px; padding: 4px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--edge);
}
#gp-line .ic { color: #ffd700; width: 22px; height: 22px; }

/* Search */
.search-box {
  position: relative; display: flex; align-items: center;
  flex: 0 1 280px; min-width: 180px;
}
.search-box .sb-ico { position: absolute; left: 10px; color: var(--dim); pointer-events: none; display: flex; }
.search-box input { padding: 7px 10px 7px 34px; font-size: 18px; background: #221d15; border-width: 1px; }
.search-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

/* Quick tips: first visit only, one tap to dismiss for good. */
#tips {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px;
  background: var(--card); border: 1px solid var(--edge); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px;
}
#tips.hidden { display: none !important; }
.tips-title { color: #ffcf6a; font-size: 19px; white-space: nowrap; }
.tips-title .ic { color: #ffd700; }
#tips ol {
  grid-column: 1 / -1; grid-row: 2; list-style: none; counter-reset: tip;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 6px 16px; font-size: 15px; line-height: 1.2;
}
#tips li { counter-increment: tip; display: flex; gap: 8px; align-items: center; }
#tips li::before {
  content: counter(tip); flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e8b53a; color: #2b251c;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
#tips li b { color: var(--parchment); font-weight: normal; text-decoration: underline dotted; }
#tips-close { padding: 3px 14px; font-size: 16px; }

/* Category chips */
#f-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cat-chip {
  padding: 5px 14px; font-size: 18px; background: var(--card);
  border: 1px solid var(--edge); border-radius: 999px !important;
}
.cat-chip .cc-n { color: var(--dim); font-size: 15px; margin-left: 2px; }
.cat-chip.on { background: #e8b53a; border-color: #e8b53a; color: #2b251c; }
.cat-chip.on .cc-n { color: #5a4516; }
.cat-chip:disabled { opacity: .4; cursor: default; }
.cat-chip:disabled:hover { border-color: var(--edge); color: var(--parchment); }

/* Secondary filters + bulk actions share one quiet row. */
#bank-toolbar { align-items: center; gap: 6px; margin-bottom: 14px; }
#bank-toolbar select { flex: 1 1 130px; min-width: 0; max-width: 190px; font-size: 16px; padding: 6px 8px; border-width: 1px; }
#bank-toolbar button { flex: 0 0 auto; min-width: 0; padding: 6px 12px; font-size: 16px; }
#bank-toolbar .qmark { padding: 0; }
.tb-split { flex: 1; }
#sell-dupes-all:disabled { opacity: .5; cursor: default; }
#sell-dupes-all:disabled:hover { border-color: var(--edge); color: var(--parchment); }

/* Bank grid: uniform, roomier cards; the art leads, the name labels it. */
.inv-head {
  display: flex; align-items: center; gap: 6px;
  color: #ffcf6a; border-bottom: 1px solid var(--edge);
  margin: 4px 0 8px; padding-bottom: 3px; font-size: 16px;
}
.inv-count {
  font-size: 13px; background: var(--card); border: 1px solid var(--edge);
  border-radius: 999px; padding: 0 7px; color: var(--dim);
}
.bank-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.bank-card {
  width: auto; min-height: 104px; padding: 10px 6px 8px; gap: 3px;
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  justify-content: center;
  transition: border-color .12s, background .12s, transform .12s;
}
.bank-card:hover { background: var(--card-hi); border-color: #8a7550; transform: translateY(-1px); }
.bank-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bank-card img { width: 44px; height: 44px; }
.bc-name { font-size: 16px; line-height: 1.05; }
.bc-sub { font-size: 13px; }
.bc-qty { top: 4px; right: 7px; font-size: 15px; color: #f2e6cc; }
.bc-worn { top: 4px; left: 7px; font-size: 15px; }
.bc-lock { position: absolute; top: 4px; left: 7px; font-size: 15px; color: var(--parchment); }
.bc-worn + .bc-lock { left: 26px; }
.bank-card.equipped { background: #3d3420; border-color: #7a6228; }
.bank-card.selected {
  border-color: #ffcf6a; background: #4a3d1e;
  box-shadow: 0 0 0 1px #ffcf6a inset, 0 0 14px rgba(255,207,106,.3);
}
.bank-card .tag-badge { top: auto; bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.bank-empty { color: var(--dim); text-align: center; padding: 36px 0; font-size: 18px; }
#bank-count { text-align: center; padding-top: 8px; border-top: 1px solid var(--edge); }
#bank-count:empty { display: none; }

/* Paper doll: the OSRS equipment-tab shape. */
#slots-grid { display: block; }
#slots-grid .doll {
  display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-areas:
    "necklace helm ring"
    "weapon   body shield"
    "gloves   legs boots";
}
.slot-weapon { grid-area: weapon; } .slot-helm { grid-area: helm; } .slot-body { grid-area: body; }
.slot-legs { grid-area: legs; } .slot-shield { grid-area: shield; } .slot-gloves { grid-area: gloves; }
.slot-boots { grid-area: boots; } .slot-ring { grid-area: ring; } .slot-necklace { grid-area: necklace; }
.doll-sub { color: var(--dim); font-size: 15px; margin: 12px 0 6px; border-bottom: 1px solid var(--edge); }
.doll-trinkets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-cell {
  position: relative; min-height: 92px; padding: 5px 4px 6px;
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  justify-content: center;
}
.slot-cell .slot-name { font-size: 12px; }
.slot-cell img { width: 38px; height: 38px; }
.slot-cell .slot-item { font-size: 15px; }
.slot-cell .slot-pow { font-size: 14px; }
.slot-cell .slot-sil { width: 30px; height: 30px; color: #4d4436; margin: 4px 0 2px; }
.slot-cell .slot-empty { color: #6b614f; margin: 0; font-size: 14px; }
.slot-cell.filled { border-color: #7a6228; background: linear-gradient(#3d3420, var(--card)); }
.slot-cell.filled:hover, .slot-cell.filled:focus-visible { border-color: #e07070; outline: none; }
.slot-off {
  position: absolute; top: 2px; right: 5px; font-size: 13px; color: #e07070;
  opacity: 0; transition: opacity .12s;
}
.slot-cell.filled:hover .slot-off, .slot-cell.filled:focus-visible .slot-off { opacity: 1; }
@media (hover: none) { .slot-off { opacity: .6; } }

/* Your stats */
#equip-summary {
  margin-top: 14px; padding: 12px; line-height: 1.2;
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
}
#equip-summary h3 { font-size: 21px; color: #f2e6cc; font-weight: normal; margin-bottom: 6px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.st-list { display: grid; gap: 3px; }
.st-row { display: flex; align-items: center; gap: 7px; font-size: 18px; min-width: 0; }
.st-row .ic { flex: none; color: var(--dim); }
.st-label { color: var(--parchment); white-space: nowrap; }
.st-row b { color: #ffcf6a; font-weight: normal; margin-left: auto; }
.st-list .st-row b { margin-left: 6px; }
.st-sep { height: 1px; background: var(--edge); margin: 8px 0; }
.st-vs { color: var(--dim); font-size: 16px; margin: 8px 0 3px; }
.st-power { margin-top: 8px; }
.st-power b { color: var(--parchment); font-weight: normal; }

/* Item details */
#item-panel .ip-head { border-bottom: 1px solid var(--edge); padding-bottom: 8px; margin-bottom: 12px; }
#item-panel .ip-head h2 { font-size: 25px; color: #f2e6cc; }
#ip-close { width: 36px; height: 36px; padding: 0; font-size: 18px; }
.sheet-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; color: var(--dim); padding: 40px 12px;
}
.sheet-placeholder .ic { width: 40px; height: 40px; color: #5a4e3c; }
#item-panel .sheet-head {
  gap: 14px; padding: 10px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
}
.sheet-art {
  flex: none; width: 76px; height: 76px; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 45%, #4a4034, #2b251c);
  display: flex; align-items: center; justify-content: center;
}
#item-panel .sheet-head img { width: 60px; height: 60px; }
#item-panel .sheet-name { font-size: 25px; line-height: 1; color: #f2e6cc; }
.sheet-worn, .sheet-owned {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 15px; padding: 1px 10px; border-radius: 999px;
}
.sheet-worn { color: #ffcf6a; border: 1px solid #b58a2a; background: rgba(232,181,58,.12); }
.sheet-owned { color: var(--parchment); border: 1px solid var(--edge); }
.sheet-locked { color: var(--dim); font-size: 14px; margin-top: 4px; }
#item-panel .sheet-rows { gap: 6px 14px; font-size: 18px; padding: 0 2px; }
#item-panel .sheet-rows > div:nth-child(odd) { white-space: nowrap; }
.att-strip { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.att-strip span { margin: 0; }
.sheet-actions {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--edge); padding-top: 12px;
}
#item-panel .sheet-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  margin: 0; padding: 9px 10px; font-size: 20px; line-height: 1.1;
  background: var(--card); border: 1px solid #6a5d48; border-radius: var(--radius);
}
.sb-main { display: inline-flex; align-items: center; gap: 7px; }
.sb-sub { font-size: 14px; color: var(--dim); }
#item-panel .sheet-btn:hover { border-color: var(--gold); color: #ffcf6a; }
#item-panel .sheet-btn.primary {
  background: linear-gradient(#f0c24e, #d9a431); border-color: #f5d27a; color: #2b251c;
}
#item-panel .sheet-btn.primary .sb-sub { color: #5a4516; }
#item-panel .sheet-btn.primary:hover { background: linear-gradient(#f7d066, #e4b03c); color: #1e1a13; }
#item-panel .sheet-btn.gold { border-color: #8a7430; color: #ffd700; }
#item-panel .sheet-btn.warn { background: #4a2622; border-color: #9c3a31; color: #ff9d90; }
#item-panel .sheet-btn.warn .sb-sub { color: #d99a92; }
#item-panel .sheet-btn.warn:hover { background: #5a2c27; border-color: #e0584b; color: #ffb3a8; }
.sell-qty { margin-top: 0; }

/* Shop & forge share the page's card language. */
#bank .pg-head { margin-top: 16px; margin-bottom: 8px; color: #ffcf6a; }
.pot-card { border-radius: var(--radius); border-width: 1px; background: var(--card); }
#store-grid, #store-gear, #store-tokens { gap: 8px; }
.recipe-card, .rumor-card, #forge-result { border: 1px solid var(--edge); }

@media (max-width: 1400px) {
  .bank-tabs button { padding: 6px 11px; font-size: 18px; }
  #gp-line { font-size: 20px; padding: 3px 12px; }
  .equip-layout .panel { padding: 12px; }
}
@media (max-width: 900px) {
  /* `1fr` alone is minmax(auto, 1fr): the column would size to its widest
   * min-content (the scrolling chip row, the tip grid) and run off a phone. */
  .equip-layout { grid-template-columns: minmax(0, 1fr); }
  .equip-layout > .panel { min-width: 0; }
  #item-panel.open { border-radius: 12px 12px 8px 8px; }
  .search-box { flex: 1 1 100%; }
}
@media (max-width: 700px) {
  .equip-layout { padding: 10px; gap: 10px; }
  .equip-layout .panel { padding: 12px; }
  .bank-tabs { flex: 1; }
  .bank-tabs button { flex: 1; padding: 8px 6px; font-size: 18px; }
  #gp-line { font-size: 20px; }
  .bank-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .bank-card { min-height: 92px; padding: 8px 4px 6px; }
  .bank-card img { width: 38px; height: 38px; }
  .bc-name { font-size: 15px; }
  #f-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .cat-chip { flex: none; }
  #bank-toolbar select { flex: 1 1 30%; max-width: none; }
  .tb-split { display: none; }
  #bank-toolbar button:not(.qmark) { flex: 1 1 40%; }
  .slot-cell { min-height: 84px; }
  .slot-cell .slot-item { font-size: 14px; }
}
