/* ===================================================================
   AimRPG Wiki — static, display-only theme
   Muted rose / dusk palette (RuneScape-wiki inspired layout)
   No external resources. No network calls. Pure presentation.
=================================================================== */

:root {
  --bg-0:        #140a10;
  --bg-1:        #1c0f17;
  --bg-2:        #271620;
  --panel:       #22121b;
  --panel-2:     #2c1824;
  --border:      #3f2735;
  --border-lit:  #5e3a4f;
  --ink:         #ece0e6;
  --ink-dim:     #b89dab;
  --ink-faint:   #866c79;
  --rose:        #d98aae;
  --rose-deep:   #9c4f73;
  --rose-glow:   #ecb0cb;
  --gold:        #d8b58f;   /* muted rose-gold for headings */
  --plum:        #9a6fa6;   /* boss accent */
  --plum-deep:   #5f3a66;
  --slime:       #8cbf6a;   /* desaturated green for slime-item chips */
  --slime-deep:  #5d8a3f;
  --danger:      #cf7d7d;
  --good:        #8cc79e;
  --radius:      10px;
  --shadow:      0 10px 30px rgba(0,0,0,.45);
  --maxw:        1080px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2030 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

img { image-rendering: pixelated; image-rendering: crisp-edges; }

a { color: var(--rose); text-decoration: none; }
a:hover { color: var(--rose-glow); text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(28,15,23,.96), rgba(20,10,16,.92));
  border-bottom: 1px solid var(--border-lit);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.brand .mark { color: var(--rose); text-shadow: 0 0 12px rgba(217,138,174,.35); font-size: 1.25rem; }
.brand .sub { color: var(--ink-faint); font-size: .8rem; letter-spacing: 2px; text-transform: uppercase; }
.brand a { color: inherit; }
.brand a:hover { text-decoration: none; }

/* ---------- search ---------- */
.search-wrap { position: relative; margin-left: auto; width: min(360px, 46vw); }
.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-family: inherit; font-size: .95rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(156,79,115,.18); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: .95rem; pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
}
.search-results.open { display: block; }
.search-results li { list-style: none; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--border); }
.search-results a:hover, .search-results a.active { background: var(--panel-2); text-decoration: none; }
.search-results li:last-child a { border-bottom: none; }
.search-results .r-type {
  margin-left: auto; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px;
  color: #170c12; background: var(--rose); padding: 2px 7px; border-radius: 999px; font-weight: 700;
}
.search-results .r-type.boss { background: var(--plum); color: #f3e9f6; }
.search-empty { padding: 14px; color: var(--ink-dim); text-align: center; font-size: .9rem; }

/* ---------- layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 80px; }
.breadcrumb { color: var(--ink-faint); font-size: .85rem; margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-dim); }

/* ---------- hero / home ---------- */
.hero { text-align: center; padding: 28px 10px 8px; }
.hero h1 {
  margin: 0; font-size: 2.4rem; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--rose-glow), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-dim); max-width: 620px; margin: 10px auto 0; }

.section-title {
  display: flex; align-items: center; gap: 12px;
  margin: 34px 0 14px; font-size: 1.15rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 2px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-lit), transparent); }

/* ---------- card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-lit); box-shadow: var(--shadow); text-decoration: none; }
.card .thumb {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(217,138,174,.12), transparent 70%);
  border: 1px solid var(--border); border-radius: 8px;
}
.card.boss .thumb { background: radial-gradient(circle at 50% 40%, rgba(154,111,166,.16), transparent 70%); }
.card .thumb img { max-width: 46px; max-height: 46px; }
.card h3 { margin: 0 0 2px; font-size: 1rem; color: var(--ink); }
.card .tag { font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1.5px; }

/* ---------- article + infobox ---------- */
.article { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.article .body h1 { margin: 0 0 4px; font-size: 2rem; color: var(--ink); }
.article .body h1 .pixel-em { color: var(--rose); }
.article .lede { color: var(--ink-dim); font-style: italic; margin: 0 0 20px; font-size: 1.05rem; }
.article h2 { margin: 28px 0 12px; font-size: 1.25rem; color: var(--gold); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article p { color: var(--ink); }
.article .body { min-width: 0; }

/* infobox (RS-wiki style) */
.infobox {
  position: sticky; top: 84px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.infobox .ib-title {
  text-align: center; padding: 10px 12px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(180deg, var(--rose-deep), #7a3a59);
  color: #1a0c13; font-size: 1.05rem;
}
.infobox.boss .ib-title { background: linear-gradient(180deg, var(--plum-deep), #45284b); color: #f3e9f6; }
.infobox .ib-art {
  display: grid; place-items: center; padding: 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(217,138,174,.08), transparent 65%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 10px, transparent 10px 20px);
}
.infobox.boss .ib-art { background: radial-gradient(circle at 50% 35%, rgba(154,111,166,.12), transparent 65%); }
.infobox .ib-art img { max-width: 180px; max-height: 240px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.ib-stats { width: 100%; border-collapse: collapse; }
.ib-stats th, .ib-stats td { padding: 8px 12px; font-size: .88rem; border-top: 1px solid var(--border); text-align: left; }
.ib-stats th { color: var(--ink-faint); font-weight: 600; width: 45%; text-transform: uppercase; letter-spacing: .5px; font-size: .76rem; }
.ib-stats td { color: var(--ink); }
.ib-section { padding: 8px 12px; background: rgba(0,0,0,.18); color: var(--gold); font-size: .72rem; text-transform: uppercase; letter-spacing: 1.5px; border-top: 1px solid var(--border); }

/* animated sprite (siren_sheet = 4 frames @141px) */
.siren-sprite {
  width: 141px; height: 256px;
  background-image: url('../img/siren_sheet.png');
  background-repeat: no-repeat;
  background-size: 564px 256px;
  image-rendering: pixelated;
  animation: siren-cycle 1.1s steps(4) infinite;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.5));
}
@keyframes siren-cycle { from { background-position: 0 0; } to { background-position: -564px 0; } }
@media (prefers-reduced-motion: reduce) { .siren-sprite { animation: none; } }

/* ---------- chips / pills / tables ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: .82rem;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--ink-dim);
}
.chip.green { border-color: var(--slime-deep); color: var(--slime); }
.chip.rose { border-color: var(--rose-deep); color: var(--rose-glow); }
.chip.plum { border-color: var(--plum-deep); color: var(--plum); }
.chip.gold { border-color: #6f5c3e; color: var(--gold); }

.data-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: .92rem; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table thead th { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; font-size: .74rem; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .obj { display: flex; align-items: center; gap: 9px; }
.data-table .obj img { width: 26px; height: 26px; }
.rate { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.rate.common { color: var(--good); }
.rate.rare   { color: var(--rose); }

/* note / callout — emoji-free, label-driven */
.note {
  padding: 12px 16px; margin: 16px 0;
  background: rgba(217,138,174,.06); border: 1px solid var(--rose-deep);
  border-left-width: 4px; border-radius: 8px;
}
.note.warn { background: rgba(207,125,125,.06); border-color: #7a3838; }
.note p { margin: 0; font-size: .92rem; color: var(--ink-dim); }
.note .lbl { display: block; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--rose-glow); margin-bottom: 3px; font-weight: 700; }
.note.warn .lbl { color: var(--danger); }
.note strong { color: var(--ink); }

/* flow / interaction chain */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
.flow .node { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); }
.flow .node img { width: 26px; height: 26px; }
.flow .arrow { color: var(--rose); font-weight: 700; }

/* footer */
.foot { text-align: center; color: var(--ink-faint); font-size: .82rem; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }

/* responsive — keep the 2-column sticky layout down to 700px so the
   infobox stays pinned on smaller/zoomed/HiDPI desktops; stack only below that */
@media (max-width: 700px) {
  .article { grid-template-columns: 1fr; }
  .infobox { position: static; max-width: 360px; margin: 0 auto 8px; }
  .search-wrap { width: 60vw; }
}
@media (max-width: 560px) {
  .brand .sub { display: none; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .hero h1 { font-size: 1.8rem; }
}
