/* ============ OSRS THEME ============ */
:root {
  --stone: #2b2620;
  --stone-dark: #1c1813;
  --wood: #3e3529;
  --wood-light: #5a4a36;
  --wood-edge: #8a6d3b;
  --gold: #ffb83f;
  --gold-dark: #b8860b;
  --yellow: #ffff00;
  --parchment: #e8dcc0;
  --parchment-dim: #b9ac8f;
  --text: #f0e6d2;
  --muted: #a89f8c;
  --green: #00ff00;
  --red: #ff3030;
  --cyan: #00ffff;
  --orange: #ff981f;
  --combat: #a83232;
  --gathering: #3f8a3f;
  --artisan: #b06f2b;
  --support: #4a6fa8;
  --panel-shadow: 0 0 0 2px #1c1813, 0 0 0 4px #6b5330, 0 4px 18px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(ellipse at top, rgba(255,184,63,.06), transparent 60%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.08) 0 2px, transparent 2px 6px),
    var(--stone);
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: "Cinzel", "Georgia", serif; color: var(--gold); margin: 0; letter-spacing: .5px; text-shadow: 1px 1px 0 #000; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ---------- OSRS panel look ---------- */
.panel {
  background: linear-gradient(180deg, #4a3f31, var(--wood));
  border: 2px solid #1c1813;
  box-shadow: var(--panel-shadow);
  border-radius: 4px;
}
.panel-title {
  background: linear-gradient(180deg, #6b5330, #4a3a22);
  border-bottom: 2px solid #1c1813;
  padding: 8px 14px;
  font-family: "Cinzel", Georgia, serif;
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  text-shadow: 1px 1px 0 #000;
  display: flex; align-items: center; gap: 8px;
}
.panel-body { padding: 12px 14px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
header.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px;
  background: linear-gradient(180deg, #4b3d2b, #2a221a);
  border-bottom: 3px solid #1c1813;
  box-shadow: 0 2px 12px rgba(0,0,0,.7);
  position: sticky; top: 0; z-index: 50;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { width: 34px; height: 34px; image-rendering: pixelated; }
.logo h1 { font-size: 20px; }
.logo small { display: block; font-size: 11px; color: var(--muted); font-family: inherit; letter-spacing: 0; }
nav.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
nav.tabs button, .btn {
  background: linear-gradient(180deg, #6b5330, #4a3a22);
  color: var(--parchment);
  border: 2px solid #1c1813;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #1c1813;
  padding: 6px 12px; cursor: pointer; border-radius: 3px; font-weight: 700; font-size: 13px;
}
nav.tabs button:hover, .btn:hover { filter: brightness(1.15); }
nav.tabs button.active { background: linear-gradient(180deg, #b8860b, #7a5a10); color: #fff; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.danger { background: linear-gradient(180deg, #8a2b2b, #4a1515); }
.btn.ok { background: linear-gradient(180deg, #2e7d32, #1b4d1e); }
.lang-btn { background: linear-gradient(180deg, #2e5060, #16303a); color: var(--cyan); min-width: 44px; letter-spacing: 1px; }

aside.sidebar { padding: 14px; border-right: 3px solid #1c1813; background: rgba(0,0,0,.25); }
main.content { padding: 18px 22px 60px; max-width: 1200px; }

/* ---------- Skill grid (OSRS stats tab) ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.skill-cell {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #3e3529, #2b2620);
  border: 1px solid #1c1813; box-shadow: inset 0 0 0 1px #5a4a36;
  padding: 5px 6px; cursor: pointer; border-radius: 2px;
  transition: filter .1s;
}
.skill-cell:hover { filter: brightness(1.3); }
.skill-cell.active { background: linear-gradient(180deg, #7a5a10, #4a3a22); box-shadow: inset 0 0 0 1px var(--gold); }
.skill-cell img { width: 22px; height: 22px; image-rendering: pixelated; }
.skill-cell .lvl { font-family: "Trebuchet MS", sans-serif; font-weight: 700; color: var(--yellow); font-size: 12px; margin-left: auto; text-shadow: 1px 1px 0 #000; line-height: 1; text-align: right; }
.skill-cell .lvl small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }
.total-row { margin-top: 8px; text-align: center; color: var(--gold); font-weight: 700; font-size: 13px; }
.sidebar .search { width: 100%; margin-bottom: 10px; }
input, select {
  background: #1c1813; color: var(--text); border: 2px solid #5a4a36; padding: 6px 8px; border-radius: 3px; font-family: inherit; font-size: 14px;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; border: 1px solid #000; vertical-align: middle; }
.legend .c-combat::before { background: var(--combat); }
.legend .c-gathering::before { background: var(--gathering); }
.legend .c-artisan::before { background: var(--artisan); }
.legend .c-support::before { background: var(--support); }
.skill-cell[data-cat="combat"] { border-left: 3px solid var(--combat); }
.skill-cell[data-cat="gathering"] { border-left: 3px solid var(--gathering); }
.skill-cell[data-cat="artisan"] { border-left: 3px solid var(--artisan); }
.skill-cell[data-cat="support"] { border-left: 3px solid var(--support); }

/* ---------- Skill page ---------- */
.skill-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.skill-header img.big { width: 56px; height: 56px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #000); }
.skill-header h2 { font-size: 26px; }
.skill-header .sub { color: var(--muted); font-size: 13px; }
.level-box { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.level-box input { width: 70px; text-align: center; font-weight: 700; color: var(--yellow); font-size: 18px; }
.xpbar { height: 14px; background: #1c1813; border: 2px solid #5a4a36; border-radius: 3px; overflow: hidden; margin: 6px 0 12px; }
.xpbar div { height: 100%; background: linear-gradient(90deg, #7a5a10, var(--gold)); transition: width .3s; }
.xptext { font-size: 12px; color: var(--muted); }

.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.subtabs button {
  background: #2b2620; color: var(--parchment-dim); border: 2px solid #1c1813; padding: 6px 12px; cursor: pointer; border-radius: 3px 3px 0 0; font-weight: 700; font-size: 13px;
}
.subtabs button.active { background: var(--wood); color: var(--gold); border-bottom-color: var(--wood); }

/* Stages timeline */
.stage { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #5a4a36; position: relative; }
.stage:last-child { border-bottom: none; }
.stage .range { text-align: center; }
.stage .range b { display: block; font-size: 22px; color: var(--yellow); text-shadow: 1px 1px 0 #000; font-family: "Cinzel", Georgia, serif; }
.stage .range small { color: var(--muted); }
.stage.current { background: linear-gradient(90deg, rgba(255,184,63,.15), transparent); border-left: 4px solid var(--gold); padding-left: 10px; }
.stage.done { opacity: .55; }
.stage.done .range b { color: var(--green); }
.stage h4 { font-size: 16px; color: var(--orange); margin-bottom: 4px; }
.stage .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--parchment-dim); margin-bottom: 6px; }
.stage .meta b { color: var(--text); }
.stage .tip { font-size: 13px; color: var(--parchment); background: rgba(0,0,0,.25); padding: 6px 10px; border-left: 3px solid var(--gold-dark); margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1c1813; border: 1px solid #5a4a36; border-radius: 3px; padding: 3px 8px 3px 4px; font-size: 12px; cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--gold); }
.chip img { width: 20px; height: 20px; image-rendering: pixelated; object-fit: contain; }
.chip.loc { background: #16222a; border-color: #2e5060; }
.badge { display: inline-block; background: #1c1813; border: 1px solid #5a4a36; color: var(--gold); font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.badge.ok { color: var(--green); border-color: #1e5a1e; }
.badge.lock { color: var(--red); border-color: #5a1e1e; }

/* Tables */
table.osrs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.osrs th { text-align: left; color: var(--gold); background: rgba(0,0,0,.35); padding: 6px 8px; border-bottom: 2px solid #1c1813; }
table.osrs td { padding: 6px 8px; border-bottom: 1px solid #2b2620; vertical-align: middle; }
table.osrs tr:hover td { background: rgba(255,255,255,.03); }
table.osrs tr.locked td { opacity: .45; }
table.osrs tr.locked td:first-child { opacity: 1; color: var(--red); }
table.osrs tr.unlocked td:first-child { color: var(--green); }
td.lvlcell { font-weight: 700; width: 48px; text-align: center; font-size: 14px; }

ul.iron-list { margin: 0; padding-left: 20px; line-height: 1.55; }
ul.iron-list li { margin-bottom: 6px; }
ul.iron-list li::marker { color: var(--gold); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } aside.sidebar { border-right: none; border-bottom: 3px solid #1c1813; } }

/* ---------- Wiki drawer ---------- */
.drawer {
  position: fixed; top: 0; right: -480px; width: 460px; max-width: 95vw; height: 100vh; z-index: 100;
  background: linear-gradient(180deg, #4a3f31, var(--wood));
  border-left: 3px solid #1c1813; box-shadow: -6px 0 24px rgba(0,0,0,.7);
  transition: right .25s ease; display: flex; flex-direction: column;
}
.drawer.open { right: 0; }
.drawer .panel-title { justify-content: space-between; }
.drawer .panel-body { overflow-y: auto; flex: 1; }
.drawer img.hero { max-width: 100%; max-height: 180px; display: block; margin: 0 auto 12px; image-rendering: auto; filter: drop-shadow(2px 2px 2px #000); }
.drawer p { line-height: 1.5; font-size: 14px; color: var(--parchment); }
.drawer .loading { color: var(--muted); font-style: italic; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; display: none; }
.overlay.open { display: block; }

/* ---------- Timers ---------- */
.timer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.timer-card { padding: 10px 12px; border: 2px solid #1c1813; background: #2b2620; border-radius: 4px; box-shadow: inset 0 0 0 1px #5a4a36; }
.timer-card .name { font-weight: 700; color: var(--gold); font-size: 14px; }
.timer-card .time { font-family: "Consolas", monospace; font-size: 26px; color: var(--yellow); text-shadow: 1px 1px 0 #000; margin: 4px 0; }
.timer-card.ready .time { color: var(--green); animation: blink 1s infinite; }
.timer-card .note { font-size: 12px; color: var(--muted); }
.timer-card .actions { display: flex; gap: 6px; margin-top: 6px; }
@keyframes blink { 50% { opacity: .4; } }
.preset-group { margin-bottom: 10px; }
.preset-group h4 { font-size: 14px; margin-bottom: 6px; color: var(--orange); }
.preset-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-btns button { font-size: 12px; }

/* ---------- Calc / Account ---------- */
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.form-row label { color: var(--parchment-dim); font-size: 13px; min-width: 120px; }
.result-big { font-size: 22px; color: var(--yellow); font-weight: 700; text-shadow: 1px 1px 0 #000; }
.levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.levels-grid label { display: flex; align-items: center; gap: 6px; background: #1c1813; padding: 4px 6px; border-radius: 3px; border: 1px solid #5a4a36; font-size: 13px; }
.levels-grid label img { width: 18px; height: 18px; image-rendering: pixelated; }
.levels-grid input { width: 52px; text-align: center; padding: 3px; margin-left: auto; }
.notice { padding: 8px 12px; background: rgba(0,0,0,.3); border-left: 3px solid var(--cyan); font-size: 13px; margin-bottom: 10px; color: var(--parchment); }
.notice.warn { border-left-color: var(--red); }

/* Routes */
.route-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.route-steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #5a4a36; align-items: start; }
.route-steps li::before { content: counter(step); display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: linear-gradient(180deg, #b8860b, #7a5a10); color: #fff; font-weight: 700; border: 2px solid #1c1813; border-radius: 50%; font-size: 13px; }
.route-steps b { color: var(--orange); }
.route-steps small { color: var(--parchment-dim); display: block; }

/* ---------- Guias populares ---------- */
.guide-card { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 12px 14px; margin-bottom: 12px; }
.guide-card img { width: 40px; height: 40px; image-rendering: pixelated; }
.guide-card h3 { font-size: 17px; margin-bottom: 4px; }
.guide-card .credit { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.guide-card .credit b { color: var(--parchment-dim); }
.guide-card .desc { font-size: 13px; color: var(--parchment); line-height: 1.45; }
.guide-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.guide-card .tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid #5a4a36; color: var(--gold); margin-left: 6px; vertical-align: middle; }
.guide-card .tag.ext { color: var(--cyan); border-color: #2e5060; }
.mirror-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mirror-bar select { max-width: 100%; }
.mirror-progress { font-size: 13px; color: var(--green); font-weight: 700; margin-left: auto; }
.wiki-mirror { background: linear-gradient(180deg, #221d17, #1c1813); color: var(--parchment); padding: 12px 14px; border-radius: 4px; border: 2px solid #5a4a36; box-shadow: inset 0 0 0 1px #1c1813; overflow-x: auto; font-size: 13px; line-height: 1.45; }
.wiki-mirror a { color: var(--cyan); }
.wiki-mirror a:visited { color: #8fd6e8; }
.wiki-mirror a.new { color: var(--red); }
.wiki-mirror img { image-rendering: pixelated; vertical-align: middle; max-width: none; }
.wiki-mirror table { border-collapse: collapse; margin: 8px 0; background: #2b2620; box-shadow: 0 0 0 2px #1c1813; }
.wiki-mirror th, .wiki-mirror td { border: 1px solid #4a3f31; padding: 4px 7px; vertical-align: top; }
.wiki-mirror th { background: linear-gradient(180deg, #6b5330, #4a3a22); color: var(--gold); text-align: left; position: sticky; top: 0; text-shadow: 1px 1px 0 #000; }
.wiki-mirror tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.wiki-mirror tr:hover td { background: rgba(255,184,63,.08); }
.wiki-mirror tr.done td { background: rgba(0,90,0,.28); text-decoration: line-through; color: var(--muted); }
.wiki-mirror tr.done td:first-child { text-decoration: none; }
.wiki-mirror tr.done td:first-child a { color: var(--green); }
.wiki-mirror h2, .wiki-mirror h3, .wiki-mirror h4 { color: var(--gold); font-family: "Cinzel", Georgia, serif; margin: 14px 0 6px; border-bottom: 1px solid #5a4a36; padding-bottom: 3px; }
.wiki-mirror p, .wiki-mirror li { color: var(--parchment); }
.wiki-mirror b, .wiki-mirror strong { color: var(--text); }
.wiki-mirror .lighttable, .wiki-mirror .wikitable { background: #2b2620; }
.wiki-mirror .table-bg-green, .wiki-mirror .table-bg-yellow, .wiki-mirror .table-bg-red, .wiki-mirror .table-bg-blue, .wiki-mirror .table-bg-gray, .wiki-mirror .table-bg-grey, .wiki-mirror td[style*="background"] { background: #2b2620 !important; }
.wiki-mirror .table-bg-green { box-shadow: inset 3px 0 0 var(--green); }
.wiki-mirror .table-bg-yellow { box-shadow: inset 3px 0 0 var(--yellow); }
.wiki-mirror .table-bg-red { box-shadow: inset 3px 0 0 var(--red); }
.wiki-mirror .table-bg-blue { box-shadow: inset 3px 0 0 var(--cyan); }
.wiki-mirror [style*="color"] { color: var(--parchment) !important; }
.wiki-mirror .mw-heading2 { border-bottom: 2px solid #6b5330; }
.wiki-mirror .tooltip, .wiki-mirror .rsw-tooltip { border-bottom: 1px dotted var(--muted); }
.wiki-mirror .hidden, .wiki-mirror .mw-collapsible-toggle { display: none; }

/* ---------- Rutas (tablero) ---------- */
.route-flow { display: flex; align-items: stretch; gap: 0; min-width: max-content; padding: 4px 2px; }
.flow-stop { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 8px 6px; background: #2b2620; border: 2px solid #5a4a36; border-radius: 6px; cursor: pointer; position: relative; text-align: center; font-size: 11px; color: var(--parchment-dim); transition: filter .1s; }
.flow-stop:hover { filter: brightness(1.25); }
.flow-stop img { width: 28px; height: 28px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(1px 1px 0 #000); }
.flow-stop + .flow-stop { margin-left: 26px; }
.flow-stop + .flow-stop::before { content: "➜"; position: absolute; left: -24px; top: 50%; transform: translateY(-50%); color: var(--gold-dark); font-size: 18px; }
.flow-stop.done { border-color: #1e5a1e; color: var(--green); background: rgba(0,90,0,.25); }
.flow-stop.done span::before { content: "✔ "; }
.flow-stop.next { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,184,63,.5); color: var(--gold); animation: pulse 1.6s infinite; }
.flow-stop.skipped { opacity: .4; border-style: dashed; }
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(255,184,63,.2); } }
.stops { display: flex; flex-direction: column; gap: 8px; }
.stop { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; background: linear-gradient(180deg, #4a3f31, var(--wood)); border: 2px solid #1c1813; border-radius: 4px; box-shadow: var(--panel-shadow); }
.stop-num { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #b8860b, #7a5a10); color: #fff; font-weight: 700; border: 2px solid #1c1813; border-radius: 50%; font-family: "Cinzel", Georgia, serif; text-shadow: 1px 1px 0 #000; }
.stop.done { opacity: .6; }
.stop.done .stop-num { background: linear-gradient(180deg, #2e7d32, #1b4d1e); }
.stop.done .stop-title b { text-decoration: line-through; color: var(--green); }
.stop.next { border-color: var(--gold); box-shadow: 0 0 0 2px #1c1813, 0 0 14px rgba(255,184,63,.45); }
.stop.skipped { opacity: .45; border-style: dashed; }
.stop-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.stop-title label { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.stop-title b { color: var(--orange); font-size: 15px; }
.stop-title input[type=checkbox] { width: 18px; height: 18px; accent-color: #b8860b; cursor: pointer; }
.stop-how { font-size: 13px; color: var(--parchment); margin-bottom: 6px; }
.stop-actions { align-self: center; }
.wiki-mirror .mw-editsection, .wiki-mirror .noexcerpt, .wiki-mirror .navbox, .wiki-mirror .messagebox { display: none; }
.wiki-mirror input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.wiki-mirror .noprint, .wiki-mirror .mw-empty-elt { display: none; }
.wiki-mirror ul { padding-left: 20px; }
.attribution { font-size: 12px; color: var(--muted); margin-top: 8px; }
.embed-frame { width: 100%; height: 82vh; border: 2px solid #1c1813; border-radius: 4px; background: #fff; }

/* ---------- Mapa ---------- */
.osrs-map { height: 52vh; min-height: 320px; border: 2px solid #1c1813; border-radius: 4px; background: #1c1813; box-shadow: inset 0 0 0 1px #5a4a36; }
.osrs-map.tall { height: 72vh; }
.leaflet-container { font-family: inherit; }
.leaflet-container a { color: var(--cyan); }
.leaflet-popup-content-wrapper { background: linear-gradient(180deg, #4a3f31, var(--wood)); color: var(--parchment); border: 2px solid #1c1813; border-radius: 4px; }
.leaflet-popup-tip { background: var(--wood); }
.leaflet-popup-content b { color: var(--gold); }
.leaflet-control-zoom a { background: #3e3529 !important; color: var(--gold) !important; border-color: #1c1813 !important; }
.leaflet-control-attribution { background: rgba(28,24,19,.85) !important; color: var(--muted) !important; font-size: 10px; }
.osrs-pin-wrap { background: none; border: none; }
.osrs-pin { position: relative; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(180deg, #b8860b, #7a5a10); border: 2px solid #1c1813; box-shadow: 0 2px 6px rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; }
.osrs-pin img { width: 24px; height: 24px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(1px 1px 0 #000); }
.osrs-pin span { position: absolute; bottom: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #1c1813; color: var(--yellow); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid #5a4a36; }
.osrs-pin.done { background: linear-gradient(180deg, #2e7d32, #1b4d1e); }
.osrs-pin.next { box-shadow: 0 0 12px 3px rgba(255,184,63,.8); }
.osrs-pin.skipped { opacity: .45; }
.osrs-pin.boss { background: linear-gradient(180deg, #8a2b2b, #4a1515); }
.osrs-pin.boss span { position: static; background: none; border: none; color: #fff; font-size: 18px; }
.osrs-pin.route-tree-run { background: linear-gradient(180deg, #2e7d32, #1b4d1e); }
.osrs-pin.route-birdhouse { background: linear-gradient(180deg, #2e5060, #16303a); }
.osrs-pin.route-lava-runes { background: linear-gradient(180deg, #b0532b, #6b2f12); }

/* ---------- Bosses ---------- */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.boss-card { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 10px; }
.boss-card.done { opacity: .6; }
.boss-card.farming { box-shadow: var(--panel-shadow), inset 0 0 0 2px #1e5a1e; }
.boss-card.learning { box-shadow: var(--panel-shadow), inset 0 0 0 2px #7a5a10; }
.boss-imgwrap { width: 110px; height: 110px; background: radial-gradient(circle, #2b2620, #1c1813); border: 2px solid #1c1813; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.boss-img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(2px 2px 2px #000); }
.boss-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.boss-title b { color: var(--gold); font-family: "Cinzel", Georgia, serif; font-size: 15px; }
.boss-req, .boss-why { font-size: 12px; line-height: 1.4; margin-bottom: 4px; }
.boss-req { color: var(--parchment-dim); }
.boss-why { color: var(--parchment); }
.boss-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.boss-actions select, .boss-actions input { padding: 3px 6px; font-size: 12px; }
.boss-actions .kc { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.badge.tier-early { color: var(--green); border-color: #1e5a1e; }
.badge.tier-mid { color: var(--yellow); border-color: #7a5a10; }
.badge.tier-late { color: var(--orange); border-color: #8a4a10; }
.badge.tier-end { color: var(--red); border-color: #5a1e1e; }
.badge.style-melee { color: #ff8080; } .badge.style-ranged { color: #9cff9c; } .badge.style-magic { color: #9cd0ff; } .badge.style-mixed { color: var(--parchment); }

/* Home */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.home-card { padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.home-card:hover { filter: brightness(1.15); }
.home-card img { width: 32px; height: 32px; image-rendering: pixelated; }
.home-card b { color: var(--gold); display: block; }
.home-card small { color: var(--muted); }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 24px; text-align: center; }

/* ============ BOSS LOOT (tarjeta que se voltea) ============ */
.boss-card { position: relative; }
.boss-card.flipped > .boss-imgwrap, .boss-card.flipped > .boss-body { visibility: hidden; }
.boss-loot { position: absolute; inset: 0; background: linear-gradient(180deg, #2b2620, #1c1813); border-radius: 4px; padding: 8px 10px; display: none; flex-direction: column; overflow: hidden; animation: lootflip .35s ease-out; }
.boss-card.flipped .boss-loot { display: flex; }
@keyframes lootflip { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
.boss-loot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--gold); font-weight: 700; }
.boss-loot-head .btn { margin-left: auto; }
.boss-loot-list { overflow-y: auto; flex: 1; font-size: 12px; }
.boss-loot-list table { width: 100%; border-collapse: collapse; }
.boss-loot-list td { padding: 2px 4px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.boss-loot-list td.ic { width: 26px; } .boss-loot-list td.ic img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.boss-loot-list td.nm { cursor: pointer; color: var(--parchment); } .boss-loot-list td.nm:hover { color: var(--gold); }
.boss-loot-list td.qty { color: var(--muted); white-space: nowrap; } .boss-loot-list td.rar { white-space: nowrap; text-align: right; }
.rar-always { color: #6ec6ff; } .rar-common { color: #7dff7d; } .rar-uncommon { color: #ffe36e; } .rar-rare { color: #ffb347; } .rar-vrare { color: #ff6b6b; }
.boss-loot .attribution { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ============ SET BUILDER ============ */
.bld { margin-top: 18px; }
.bld-cols { display: grid; grid-template-columns: 250px 1fr 1.2fr; gap: 16px; }
@media (max-width: 1000px) { .bld-cols { grid-template-columns: 1fr; } }
.bld-grid { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; margin: 4px auto 10px; }
.bld-slot { position: relative; width: 56px; height: 56px; border: 2px solid #1c1813; border-radius: 4px; background: radial-gradient(circle, #3e3529, #1c1813); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: inset 0 0 0 1px #5a4a36; }
.bld-slot:hover { filter: brightness(1.25); }
.bld-slot img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(1px 1px 1px #000); }
.bld-slot img.ph { opacity: .35; }
.bld-slot.filled { border-color: #8a6d3b; }
.bld-slot.lock { box-shadow: inset 0 0 0 2px #7a1e1e; }
.bld-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #000; background: #4a1515; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.bld-eqlist { display: flex; flex-wrap: wrap; gap: 4px; }
.bld-eqlist .chip img { width: 18px; height: 18px; image-rendering: pixelated; margin-right: 4px; vertical-align: middle; }
.bld-eqlist .chip.lock { border-color: #7a1e1e; color: var(--red); }
.bld-statcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.bld-stats b { display: block; color: var(--gold); margin-bottom: 4px; font-size: 13px; }
.bld-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 6px; background: rgba(0,0,0,.25); margin-bottom: 2px; border-radius: 3px; }
.bld-stat .pos { color: var(--green); } .bld-stat .neg { color: var(--red); }
.bld-ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 10px; }
.bld-ctrls label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.bld-ctrls select { width: 100%; }
.bld-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.bld-big { background: rgba(0,0,0,.3); border: 1px solid #5a4a36; border-radius: 4px; padding: 6px 8px; text-align: center; }
.bld-big small { display: block; color: var(--muted); font-size: 11px; } .bld-big b { color: var(--yellow); font-size: 20px; }
.bld-notes { font-size: 12px; color: var(--parchment); line-height: 1.5; }
.bld-notes .warn { color: var(--red); } .bld-notes .ok { color: var(--green); }
.bld-foot { color: var(--muted); font-size: 11px; margin-top: 6px; }
.bld-only { font-size: 12px; color: var(--parchment); display: block; margin-bottom: 8px; }
.bld-hint { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bld-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; }
.bld-row:hover { background: rgba(255,255,255,.05); }
.bld-row img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.bld-row-body { flex: 1; min-width: 0; }
.bld-row-name { color: var(--gold); font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.bld-row.lock .bld-row-name { color: var(--red); }
.bld-row-stats { font-size: 11px; color: var(--muted); }
.bld-row-req { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }

.bld-ctrls label.bld-check { flex-direction: row; align-items: center; color: var(--parchment); grid-column: span 2; }

/* ============ SET BUILDER: boss, banco, mejor set ============ */
.bld-boss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 8px 10px; background: rgba(0,0,0,.25); border: 1px solid #5a4a36; border-radius: 4px; font-size: 13px; }
.bld-boss label { color: var(--gold); font-weight: 700; }
.bld-boss select { max-width: 240px; }
.bld-mon { color: var(--parchment); font-size: 12px; } .bld-mon select { margin-right: 6px; }
.bld-boss .warn { color: var(--red); } .bld-boss .loading { color: var(--muted); font-style: italic; }
.bld-big.hl { border-color: var(--gold-dark); } .bld-big.hl b { color: var(--green); }
.bld-ta { width: 100%; min-height: 160px; background: #1c1813; color: var(--text); border: 1px solid #5a4a36; border-radius: 4px; padding: 6px; font-family: monospace; font-size: 12px; box-sizing: border-box; }
.bld-steps { font-size: 13px; color: var(--parchment); padding-left: 20px; line-height: 1.5; margin: 0 0 8px; }
.best-card { border: 1px solid #5a4a36; border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; background: rgba(0,0,0,.25); }
.best-card.top { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dark); }
.best-head { display: flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.best-head b { color: var(--yellow); } .best-head .btn { margin-left: auto; }
.best-stats { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ============ Vinculo con RuneLite ============ */
.link-box { border: 1px solid var(--gold-dark); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; background: rgba(0,0,0,.25); }
.link-box > b { color: var(--gold); display: block; margin-bottom: 4px; }
.link-code { font-family: 'Cinzel', serif; font-size: 28px; letter-spacing: 6px; color: var(--yellow); background: #1c1813; border: 2px solid var(--gold-dark); border-radius: 4px; padding: 4px 14px; user-select: all; }

/* ============ Vinculo v2: estado, toast, comparativo ============ */
.link-box.linked { border-color: #1e5a1e; }
.link-done { margin-top: 8px; padding: 10px 12px; background: rgba(0,80,0,.35); border: 1px solid #1e5a1e; border-radius: 4px; color: var(--green); font-weight: 700; font-size: 14px; line-height: 1.4; }
.bld-linked { margin-top: 8px; font-size: 12px; color: var(--green); }
.bld-linked a { color: var(--cyan); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1c1813; color: var(--green); border: 2px solid #1e5a1e; border-radius: 6px; padding: 10px 18px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.6); opacity: 0; transition: all .3s; z-index: 9999; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.best-group { color: var(--gold); margin: 12px 0 6px; font-size: 14px; }
.bld-eqlist .chip.missing { border-style: dashed; opacity: .75; }

/* ============ Set recomendado por la wiki ============ */
.rec-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.rec-table td { padding: 4px 4px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.rec-slot { width: 70px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.rec-rank { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 0 8px 4px 0; }
.rec-rank > .badge { color: var(--muted); }
.rec-rank .chip img { width: 16px; height: 16px; image-rendering: pixelated; margin-right: 3px; vertical-align: middle; }
.chip.have { border-color: #1e5a1e; color: var(--green); }
.chip.picked { box-shadow: 0 0 0 1px var(--gold); }
