:root {
  /* arcane purple — accent sampled from the game's splash gem + Encyclopedia ribbon (magenta-violet) */
  --bg:        #140a24;
  --bg-2:      #1e1036;
  --card:      #241340;
  --card-2:    #2e1a4e;
  --border:    #46286e;
  --text:      #f1e8fb;
  --text-dim:  #c0a8da;
  --text-mute: #8c75aa;
  --accent:    #c02ad4;
  --accent-2:  #e472ff;
  --buff:      #4ade80;
  --buff-bg:   rgba(74, 222, 128, 0.12);
  --nerf:      #ff6b6b;
  --nerf-bg:   rgba(255, 107, 107, 0.12);
  --new:       #d0a3ff;
  --new-bg:    rgba(192, 132, 252, 0.16);
  --changed:   #f5c84b;
  --changed-bg:rgba(245, 200, 75, 0.12);
  --removed:   #ff6b6b;
  --added:     #4ade80;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

body {
  background:
    radial-gradient(900px 480px at 50% 60px, rgba(228, 80, 255, 0.22), transparent 62%),
    radial-gradient(1100px 600px at 50% -120px, rgba(150, 60, 255, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(20, 10, 36, 0.72) 0%, rgba(20, 10, 36, 0.9) 46%, var(--bg) 80%),
    url("cover.png?v=20260626l") center -30px / 820px auto no-repeat,
    var(--bg);
  background-attachment: scroll, scroll, scroll, fixed, scroll;
  min-height: 100vh;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------- header ---------- */
.site-header { text-align: center; margin-bottom: 28px; }

.site-logo {
  display: block;
  width: min(340px, 76%);
  height: auto;
  margin: 4px auto 2px;
  filter: drop-shadow(0 4px 22px rgba(228, 80, 255, 0.5));
}

.ribbon-title {
  width: 288px;
  height: 89px;            /* ~3.24:1 — matches the ribbon sprite to avoid distortion */
  max-width: 80%;
  margin: -6px auto 16px;
  background: url("ribbon.png?v=20260626l") center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
.ribbon-title span {
  transform: translateY(-18px);   /* sit centered on the banner's flat band (band center ≈ 30% of ribbon height) */
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 2px 3px rgba(40, 0, 40, 0.6);
}

.version-picker {
  display: inline-flex;
  align-items: center;
}
.version-picker label {
  color: var(--text-mute);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.version-picker select {
  appearance: none;
  color: #fff;
  text-shadow: 0 1px 2px rgba(40, 0, 40, 0.5);
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 8px 38px 8px 16px;
  cursor: pointer;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23ffffff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"),
    linear-gradient(180deg, var(--accent-2), var(--accent));
  background-repeat: no-repeat, no-repeat;
  background-position: right 14px center, center;
  box-shadow: 0 2px 14px rgba(192, 42, 212, 0.45);
}
.version-picker select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- version block ---------- */
.version-block {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 10px;
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.version-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}
.version-head h2 {
  margin: 0;
  font-size: 1.7rem;
}
.version-head .vtag { color: var(--accent); font-weight: 800; }
.version-head .vdate {
  color: var(--text-mute);
  font-size: 0.82rem;
  margin-left: 8px;
}
.version-head .vsummary {
  margin: 8px 0 0;
  color: var(--text-dim);
}

/* ---------- section ---------- */
.section { padding: 20px 0; border-bottom: 1px solid rgba(50, 42, 68, 0.5); }
.section:last-child { border-bottom: none; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 1.18rem;
  font-weight: 700;
}
.section-title .emoji { font-size: 1.2rem; }
.section-note {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.group { margin-top: 14px; }
.group-label {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  margin: 0 0 8px;
}

ul.items { list-style: none; margin: 0; padding: 0; }
ul.items li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
}
ul.items li + li { margin-top: 2px; }
ul.items li:hover { background: rgba(255, 255, 255, 0.03); }

.perk-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  image-rendering: auto;
}
.item-text { flex: 1; }
.item-text .em { color: var(--text-mute); }

/* arrow inside change text */
.arrow { color: var(--accent); font-weight: 700; padding: 0 2px; }

/* bullet for plain (iconless) items */
li.plain { padding-left: 10px; }
li.plain .item-text::before {
  content: "›";
  color: var(--accent);
  font-weight: 800;
  margin-right: 8px;
}

/* tags */
.tag {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.tag-buff    { color: var(--buff);    background: var(--buff-bg);    border-color: rgba(74, 222, 128, 0.3); }
.tag-nerf    { color: var(--nerf);    background: var(--nerf-bg);    border-color: rgba(255, 107, 107, 0.3); }
.tag-new     { color: var(--new);     background: var(--new-bg);     border-color: rgba(192, 132, 252, 0.3); }
.tag-changed { color: var(--changed); background: var(--changed-bg); border-color: rgba(245, 200, 75, 0.3); }

/* ---------- footer / errors ---------- */
.site-footer {
  text-align: center;
  margin-top: 28px;
  color: var(--text-mute);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.error {
  background: var(--card);
  border: 1px solid var(--nerf);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--nerf);
}

/* ---------- utility ---------- */
.is-hidden { display: none !important; }

/* ---------- mode tabs + controls ---------- */
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.mode-tab {
  font: inherit;
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}
.mode-tab.is-active {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 2px 14px rgba(192, 42, 212, 0.55);
  text-shadow: 0 1px 2px rgba(40, 0, 40, 0.5);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
#version-controls { margin-bottom: 14px; }
#db-search {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  min-width: 240px;
}
#db-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.ghost-btn {
  font: inherit;
  font-weight: 600;
  color: var(--accent-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.ghost-btn:hover { border-color: var(--accent); }

/* ---------- player notes: multi-line perk block ---------- */
li.perk-change {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
}
.change-body { flex: 1; min-width: 0; }
.change-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.change-name { font-weight: 700; }
.change-line {
  color: var(--text-dim);
  padding: 1px 0 1px 14px;
  position: relative;
}
.change-line::before {
  content: "•";
  color: var(--accent);
  position: absolute;
  left: 0;
}

/* ---------- full database ---------- */
.db-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.db-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 14px 16px;
  cursor: pointer;
}
.db-section-head:hover { background: rgba(255, 255, 255, 0.03); }
.db-section-head .chev { color: var(--accent); width: 14px; }
.db-section-label { font-weight: 700; flex: 1; }
.db-count { color: var(--text-mute); font-size: 0.78rem; }

.db-section-body { padding: 4px 12px 14px; }

.entity {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  margin: 8px 0;
  padding: 10px 12px;
}
.entity-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.entity-id { font-weight: 700; font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 0.92rem; }
.renamed-from { color: var(--text-mute); font-size: 0.74rem; font-style: italic; }

.badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
}
.badge-changed   { color: var(--changed); background: var(--changed-bg); }
.badge-buffed    { color: var(--buff);    background: var(--buff-bg); }
.badge-nerfed    { color: var(--nerf);    background: var(--nerf-bg); }
.badge-added     { color: var(--new);     background: var(--new-bg); }
.badge-removed   { color: var(--new);     background: var(--new-bg); }
.badge-renamed   { color: var(--new);     background: var(--new-bg); }
.badge-unchanged { color: var(--text-mute); background: rgba(255,255,255,0.05); }

.fields { display: flex; flex-direction: column; gap: 2px; }
.field {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.88rem;
}
.field-changed { background: rgba(245, 200, 75, 0.06); }
.field-buff    { background: rgba(74, 222, 128, 0.06); }
.field-nerf    { background: rgba(255, 107, 107, 0.06); }
.field-added   { background: rgba(192, 132, 252, 0.06); }
.field-removed { background: rgba(192, 132, 252, 0.06); }
.field-buff .field-status { color: var(--buff); }
.field-nerf .field-status { color: var(--nerf); }
.field-added   .field-status { color: var(--new); }
.field-removed .field-status { color: var(--new); }
.field-renamed { background: rgba(192, 132, 252, 0.06); }
.field-was { color: var(--new); font-size: 0.72rem; font-style: italic; opacity: 0.85; }
.field-internal {
  margin-left: 7px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  vertical-align: middle;
}
.field-renamed .field-status { color: var(--new); }
.field-label { color: var(--text-dim); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; word-break: break-word; }
.field-val { color: var(--text); }
.v-from { color: var(--text-mute); }
.v-to { color: var(--text); font-weight: 600; }
.v-same { color: var(--text-dim); }
.strike { text-decoration: line-through; }
.field-status { color: var(--text-mute); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: right; }
.field-changed .field-status { color: var(--changed); }
.field-added   .field-status { color: var(--new); }
.field-removed .field-status { color: var(--new); }
.fields-empty { color: var(--text-mute); font-size: 0.82rem; padding: 6px 8px; font-style: italic; }

.perk-icon.sm { width: 28px; height: 28px; flex-basis: 28px; }

/* ---------- mobile ---------- */
@media (max-width: 540px) {
  .page { padding: 22px 14px 60px; }
  .site-title { font-size: 2rem; }
  .version-block { padding: 20px 16px 6px; }
  .perk-icon { width: 32px; height: 32px; flex-basis: 32px; }
  ul.items li { gap: 9px; }
  #db-search { min-width: 0; flex: 1; }
  .field { grid-template-columns: 1fr auto; }
  .field-status { display: none; }
}
