/* Ravena Wiki — cream / sky / lavender theme; legacy base geometry (client/src/ui/hud2/v5-ui.css): flat dark panels, rounded corners, bold white
   text, blue buttons, no drawn frames. Colours = the v5 tokens. */
:root {
  --bg: #f5f3fb; --page: #f5f8fb; --win: #fffdf5; --card: #f4f3fb; --card-hi: #e9edf8; --sunk: #edf3f8; --edge: #cbd9e6;
  --top: rgba(170, 205, 255, .16); --line: rgba(150, 190, 255, .12); --text: #354962; --dim: #5d7086; --faint: #718198;
  --accent: #33779e; --gold: #8b651f; --red: #b6475c; --green: #34795c; --btn: #e3e0f4; --btn-hi: #d7e3f2; --blue: #c4dfef;
  --on-accent: #ffffff; --title: #416b91; --r: 12px; --top-h: 56px; --side-w: 264px;
  --shadow: 0 18px 40px rgba(74, 94, 129, .10), 0 2px 6px rgba(74, 94, 129, .06);
  --font: 'Google Sans', 'Noto Sans Thai', Tahoma, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 500 15px/1.55 var(--font); color: var(--text); min-height: 100vh;
  background: radial-gradient(rgba(140, 180, 255, .05) 1px, transparent 1.5px) 0 0 / 30px 30px, linear-gradient(#f3eef9, var(--page)) fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: fixed; inset: 0 0 auto 0; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 12px; z-index: 30;
  background: #fffdf5; border-bottom: 1px solid #cfdae7; box-shadow: 0 4px 16px rgba(74, 94, 129, .10);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand small { color: var(--accent); font-weight: 700; font-size: 14px; }
.menu { display: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--btn); padding: 10px 9px; flex: none; cursor: pointer; }
.menu span { display: block; height: 3px; border-radius: 2px; background: #354962; margin: 3px 0; }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; height: 40px; border-radius: 20px; border: 1px solid var(--edge); background: var(--sunk); color: var(--text);
  padding: 0 16px; font: 600 15px var(--font); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 186, 253, .2); }
.results {
  position: absolute; top: 46px; left: 0; right: 0; max-height: min(70vh, 520px); overflow: auto; z-index: 40;
  background: var(--win); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px;
}
.results a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; color: var(--text); }
.results a:hover { background: var(--card-hi); text-decoration: none; }
.results img, .results i { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: var(--sunk); flex: none; }
.results span { display: flex; flex-direction: column; min-width: 0; }
.results b { font-weight: 700; }
.results small { color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results p { margin: 8px; color: var(--dim); }
.lang { display: flex; background: var(--sunk); border: 1px solid var(--edge); border-radius: 20px; padding: 3px; flex: none; }
.lang button { border: 0; background: transparent; color: var(--dim); font: 700 13px var(--font); padding: 6px 12px; border-radius: 16px; cursor: pointer; }
.lang button.on { background: var(--accent); color: var(--on-accent); }

/* ---------------------------------------------------------------- side nav */
.side {
  position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top)); bottom: 0; left: 0; width: var(--side-w); overflow-y: auto; z-index: 20;
  padding: 14px 10px 30px max(10px, env(safe-area-inset-left)); background: #fffdf5; border-right: 1px solid #cfdae7;
}
.grp h4 { margin: 14px 8px 6px; color: var(--title); font-size: 12.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.side a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 14.5px; }
.side a:hover { background: var(--card); text-decoration: none; }
.side a.on { background: var(--blue); }
.side a img, .side a i { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; flex: none; }
.side .built { color: var(--faint); font-size: 12px; margin: 18px 8px 0; }
.shade { display: none; }

/* ---------------------------------------------------------------- page */
.page { margin-left: var(--side-w); padding: calc(var(--top-h) + env(safe-area-inset-top) + 18px) max(22px, env(safe-area-inset-right)) 60px 22px; max-width: calc(var(--side-w) + 1120px); }
.card {
  position: relative; margin: 0 0 16px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--edge);
  background: linear-gradient(#faf7ff, var(--win)); box-shadow: inset 0 1px 0 var(--top), var(--shadow); scroll-margin-top: calc(var(--top-h) + 14px);
}
.card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card h2::before, .card h2::after { content: ''; height: 1px; flex: 1; min-width: 14px; max-width: 60px; background: linear-gradient(90deg, transparent, rgba(220, 232, 250, .55)); }
.card h2::after { transform: scaleX(-1); }
.card h2 small { color: var(--dim); font-weight: 600; font-size: 13px; }
.card h3 { margin: 14px 0 8px; font-size: 15.5px; color: var(--title); }
.card p { margin: 6px 0 10px; color: #4d617a; }
.card.hl, .skill.hl, .tcard.hl, .fcard.hl { animation: hl 1.6s ease-out; }
@keyframes hl { 0% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero { display: flex; gap: 16px; align-items: center; margin: 0 0 16px; padding: 16px 18px; border-radius: var(--r); background: linear-gradient(120deg, #e3f0f7, var(--win)); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--top); }
.hero > img { width: 76px; height: 76px; border-radius: 16px; flex: none; }
.hero h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; }
.hero p { margin: 4px 0; color: var(--dim); }
.banner { position: relative; margin: 0 0 16px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--edge); min-height: 120px; background: var(--win); }
.banner .art { display: block; width: 100%; height: 200px; object-fit: cover; }
.banner > div { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 18px 12px; background: linear-gradient(transparent, rgba(8, 18, 34, .9)); }
.banner h1 { margin: 0; font-size: 26px; text-shadow: 0 2px 6px #000; }
.banner p { margin: 2px 0 0; color: #dbe6f7; font-weight: 600; }

/* icons */
.ic { width: 40px; height: 40px; object-fit: contain; border-radius: 9px; background: var(--sunk); flex: none; vertical-align: middle; }
.ic.xs { width: 22px; height: 22px; border-radius: 5px; }
.ic.sm { width: 32px; height: 32px; }
.ic.lg { width: 56px; height: 56px; border-radius: 12px; }
.ic.xl { width: 84px; height: 84px; border-radius: 18px; }
.ic.sk { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--blue); background: #f0f4fa; }
.ic.mobi { width: 76px; height: 76px; border-radius: 14px; }
.ic-empty { display: inline-block; }

/* grids */
.grid { display: grid; gap: 12px; }
.cats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r); background: linear-gradient(#f3f0fb, var(--win)); border: 1px solid var(--edge); color: var(--text); box-shadow: inset 0 1px 0 var(--top); }
.cat:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.cat b { font-size: 16px; } .cat small { color: var(--dim); }
.maps { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 16px; }
.mapc { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--win); border: 1px solid var(--edge); color: var(--text); }
.mapc:hover { border-color: var(--accent); text-decoration: none; }
.mapc .thumb { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--sunk); }
.mapc b { padding: 8px 12px 0; } .mapc small { padding: 0 12px 10px; color: var(--dim); }
.tree { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--sunk); }
.tree .kids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 3; min-width: 280px; }
.node { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--edge); color: var(--text); min-width: 0; }
.node.t1 { flex: 1; min-width: 150px; background: var(--card-hi); }
.node:hover { border-color: var(--accent); text-decoration: none; }
.node b { font-size: 15px; } .node small { color: var(--dim); font-size: 12.5px; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.skill { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 14px); }
.sk-body { min-width: 0; flex: 1; }
.sk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sk-head b { font-size: 15.5px; margin-right: 2px; }
.skill p { margin: 4px 0; font-size: 14px; color: #4c6179; }
.need { color: var(--faint); font-size: 12.5px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.facts span { background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; color: #4c6179; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--btn); color: #405572; }
.chip.k-passive { background: #e5dff2; } .chip.k-active { background: var(--blue); } .chip.k-buff { background: #d9eee4; } .chip.k-ult { background: #f2e3d0; }
.chip.gold { background: var(--gold); color: #ffffff; }
.chip.armor { background: #e4d9f2; color: #674b86; }

/* tables */
.tw { overflow-x: auto; margin: 8px 0 12px; border-radius: 10px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { position: sticky; top: 0; background: #e1edf5; color: var(--title); font-weight: 700; text-align: left; padding: 8px 10px; white-space: nowrap; }
td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
table.num td { white-space: nowrap; }
td .ic { margin-right: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; font-weight: 600; }
.list { margin: 4px 0 10px; padding-left: 20px; } .list li { margin: 4px 0; color: #4d617a; }

/* monsters */
.mob-head { display: flex; gap: 14px; align-items: center; }
.mob h2 { justify-content: flex-start; margin-bottom: 6px; } .mob h2::before, .mob h2::after { display: none; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stats span { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 3px 8px; border-radius: 8px; background: var(--sunk); }
.stats small { color: var(--dim); font-size: 11.5px; } .stats b { font-size: 14px; }
.drops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.drops > small { color: var(--dim); font-weight: 700; margin-right: 4px; }
.drop { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px 3px 4px; font-size: 13.5px; }
.drop b { color: var(--gold); }
details { margin-top: 8px; } summary { cursor: pointer; color: var(--dim); font-weight: 700; font-size: 13.5px; }

/* items / cards / fashion */
.slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.slot, .pet, .pack { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.slot b, .pet b, .pack b { font-size: 13.5px; } .pet small, .pack small { color: var(--dim); font-size: 12.5px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.item { display: flex; gap: 12px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.item p { margin: 3px 0; font-size: 13.5px; color: var(--dim); }
.stone { display: flex; gap: 12px; margin-bottom: 8px; } .stone > div { flex: 1; min-width: 0; } .stone small { color: var(--dim); }
.cardg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tcard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 10px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 14px); }
.tcard.boss { border-color: var(--gold); }
.cimg { width: 120px; height: 168px; object-fit: contain; }
.tcard b { font-size: 14px; } .tcard small { color: var(--dim); font-size: 12px; } .tcard p { margin: 2px 0 0; font-size: 12.5px; color: var(--gold); }
.fash { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.fcard { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; scroll-margin-top: calc(var(--top-h) + 14px); }
.fimg { width: 100%; height: 190px; object-fit: contain; background: radial-gradient(circle at 50% 40%, #e9edf8, var(--sunk)); border-radius: 10px; }
.fcard small { color: var(--dim); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--gold); font-weight: 700; font-size: 13px; }
.pets { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.packs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* a line about the test period (free Premium / fashion / pets) */
.note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: rgba(254, 194, 64, .12); border: 1px solid rgba(254, 194, 64, .4); color: #795d27 !important; font-size: 14px; }

/* daily login sheet */
.daily { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.dday { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.dday > b { font-size: 13px; color: var(--dim); }
.dday.big { border-color: var(--gold); background: linear-gradient(#f0e7f8, var(--card)); }
.dday.big > b { color: var(--gold); }
.dday .drop { font-size: 12.5px; }

/* FAQ — one card a question, tap to open */
.faq-tools { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.faq-tools input { height: 42px; border-radius: 21px; border: 1px solid var(--edge); background: var(--sunk); color: var(--text); padding: 0 18px; font: 600 15px var(--font); outline: none; }
.faq-tools input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 186, 253, .2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--edge); background: var(--btn); color: #405572; font: 700 13px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chips button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* the Equipment page's gear finder (render.ts finderCard · wiki.js eqFilter) */
.eq-lv { display: flex; align-items: center; gap: 8px; font: 700 14px var(--font); color: var(--title); }
.eq-tools .eq-lv input { width: 84px; height: 40px; padding: 0 12px; text-align: center; }
.eqf td small { display: block; color: var(--muted, #6b7d95); font-size: 12px; font-weight: 600; }
.eqf td:nth-child(4) { white-space: nowrap; }
.eqf td:nth-child(5) { min-width: 180px; }
.faqs { display: flex; flex-direction: column; gap: 8px; }
.faq { margin: 0; border-radius: var(--r); border: 1px solid var(--edge); background: linear-gradient(#faf7ff, var(--win)); box-shadow: inset 0 1px 0 var(--top); scroll-margin-top: calc(var(--top-h) + 14px); }
.faq[open] { border-color: #9c8dc2; }
.faq summary { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 13px 16px; color: var(--text); font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--blue); font-weight: 700; }
.faq[open] summary::before { content: '−'; background: var(--accent); color: var(--on-accent); }
.faq .fq { flex: 1; min-width: 60%; font-weight: 700; }
.faq .asked { font-size: 12.5px; font-weight: 700; color: var(--on-accent); background: var(--gold); padding: 2px 9px; border-radius: 999px; }
.faq .fcat { font-style: normal; font-size: 12px; color: var(--dim); }
.fa { padding: 0 16px 12px 50px; }
.fa p, .fa li { color: #4d617a; font-size: 14.5px; }
.fa .more { color: var(--dim); font-size: 13.5px; }
.list.cols { columns: 2 220px; }

/* ---------------------------------------------------------------- phones / tablets */
@media (max-width: 900px) {
  :root { --top-h: 52px; }
  .menu { display: block; }
  .side { transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); width: min(84vw, 300px); background: #fffdf5; }
  body.drawer .side { transform: none; }
  body.drawer .shade { display: block; position: fixed; inset: 0; background: rgba(2, 8, 20, .5); z-index: 15; }
  .page { margin-left: 0; padding: calc(var(--top-h) + env(safe-area-inset-top) + 12px) max(12px, env(safe-area-inset-right)) 40px max(12px, env(safe-area-inset-left)); }
  .brand small { display: none; }
  .skills, .items { grid-template-columns: 1fr; }
  .tree .kids { min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); flex-basis: 100%; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .brand b { font-size: 17px; }
  .lang button { padding: 6px 9px; }
  .card { padding: 13px 12px; }
  .hero { padding: 12px; gap: 12px; } .hero h1, .banner h1 { font-size: 21px; } .hero > img, .ic.xl { width: 60px; height: 60px; }
  .banner .art { height: 150px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat { padding: 10px; } .cat b { font-size: 14.5px; }
  .maps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mapc .thumb { height: 86px; }
  .cardg { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fimg { height: 150px; }
  .tree .kids { grid-template-columns: 1fr; }
  .ic.mobi { width: 60px; height: 60px; }
  table { font-size: 13px; } th, td { padding: 6px 8px; }
}
/* landscape phones (844×390 · 667×375 · 737×275): a slimmer bar, more lines on screen */
@media (max-height: 460px) and (orientation: landscape) {
  :root { --top-h: 46px; }
  .search input { height: 34px; } .menu { width: 36px; height: 36px; padding: 8px 8px; } .brand img { width: 28px; height: 28px; }
  .banner .art { height: 130px; }
}

/* Shared cream / sky / lavender palette, matching the approved game inventory. */
.top { background: #fffdf5; }
.side { background: #fffdf5; }
.side a { min-height: 44px; }
.side a.on { background: #dceaf5; color: #2e5474; }
.card h2::before, .card h2::after { background: linear-gradient(90deg, transparent, #bdcde0); }
.card-links { display:flex; flex-wrap:wrap; gap:8px; }
.card-links a { padding:10px 14px; min-height:44px; border:1px solid var(--edge); border-radius:10px; background:var(--sunk); font-size:14px; }
.cat { min-width:0; }
.cat small { overflow-wrap:anywhere; }
.lang button, .chips button { min-height:44px; }
.lang button.on { color:#fff; }
.menu { width:44px; height:44px; }
.menu span { background:#435b7a; }
.banner h1 { color:#fff; }
.banner p { color:#e8f1ff; }
.chip.k-active, .chip.k-buff, .chip.k-ult, .chip.k-passive { color:#354962; }
.faq summary::before { color:#354962; }
.faq[open] summary::before { color:#fff; }
.note { background:#fff3d8; border-color:#e0c995; }
.tcard p { color:#4b617d; }
.fimg { background:radial-gradient(circle at 50% 40%,#fffaf0,var(--sunk)); }
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible { outline:3px solid #917bb6; outline-offset:3px; }
@media (max-height:460px) and (orientation:landscape) { .menu {width:44px;height:44px;} }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after {animation:none!important;transition:none!important;} }

/* Class equipment: large named disclosure targets, tables scroll within their own group on phones. */
.class-gear-group { border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin:10px 0; }
.class-gear-group > summary { min-height:36px; color:var(--text); line-height:1.6; }
.class-gear-group > summary .ic { margin:0 6px 0 2px; }
.class-gear-group[open] > summary { padding-bottom:8px; border-bottom:1px solid var(--line); }
.class-gear-nav { display:flex; flex-wrap:wrap; gap:6px 12px; }
