/* Night Camp Card Book — theme follows nightcamp_bot/web/style.css */
:root {
  --bg: #f3ead2; --card: #fffcf2; --card2: #fff1c4; --navy: #22304f; --navy2: #2f3f66; --ink: #0e1730; --txt: #1c2541;
  --sub: #6e6a5e; --soft: #e4d8b6; --green: #2c9a57; --red: #e0435b; --blue: #3a6fe0; --gold: #e0a800; --orange: #e8762f;
  --pink: #ec6a95; --mint: #86dca2; --purple: #8a5cf0; --yel: #ffd23f; --yel-l: #ffe88a; --yel-d: #f2b200;
  --r: 18px; --edge: 3px solid var(--navy); --drop: 0 4px 0 var(--navy);
  font-family: "Leelawadee UI", "Segoe UI", Tahoma, sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); }
body { display: grid; grid-template-columns: 88px 1fr; overflow: hidden; user-select: none; }
.hidden { display: none !important; }
.grow { flex: 1; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- rail ---------- */
#rail { background: var(--navy); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 8px; overflow-y: auto; }
.logo { width: 54px; height: 54px; border-radius: 16px; background: var(--yel); border: 3px solid var(--ink); flex: none;
        display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--navy); margin-bottom: 8px; }
.rail-btn { width: 66px; padding: 8px 0 6px; border: 0; border-radius: 16px; background: transparent; color: #c9d2ea; cursor: pointer;
            display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; flex: none; text-decoration: none; }
.rail-btn svg { width: 24px; height: 24px; }
.rail-btn:hover { background: var(--navy2); color: #fff; }
.rail-btn.on { background: var(--yel); color: var(--navy); font-weight: 700; }

/* ---------- main ---------- */
#main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
header { display: flex; align-items: center; gap: 14px; padding: 14px 20px 8px; flex: none; }
.who { flex: 1; min-width: 0; }
.who h1 { margin: 0; font-size: 21px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who .sub { color: var(--sub); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { background: var(--card); border: var(--edge); border-radius: 999px; padding: 2px 12px; font-size: 12px; font-weight: 700; }

.search { display: flex; align-items: center; gap: 8px; background: #fff; border: var(--edge); border-radius: 12px; padding: 5px 10px; width: 300px; max-width: 38vw; }
.search svg { width: 18px; height: 18px; color: var(--sub); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }

.seg { display: inline-flex; border: var(--edge); border-radius: 12px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--card); padding: 5px 12px; font-weight: 800; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 3px solid var(--navy); }
.seg button.on { background: var(--yel); }

/* ---------- filters ---------- */
.filters { flex: none; padding: 2px 20px 10px; display: flex; flex-direction: column; gap: 7px; }
.frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flabel { font-size: 12px; font-weight: 800; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; min-width: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2.5px solid var(--navy); border-radius: 999px; background: var(--card); padding: 2px 10px; font-weight: 700; font-size: 12.5px;
        cursor: pointer; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 0 var(--navy); }
.chip:hover { background: var(--card2); }
.chip:active { transform: translateY(2px); box-shadow: none; }
.chip.on { background: var(--navy); color: #fff; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--sub)); border: 1.5px solid var(--navy); flex: none; }
.chip.on i { border-color: #fff; }
#clearBtn { box-shadow: 0 2px 0 var(--navy); }

select { border: var(--edge); border-radius: 11px; background: #fff; padding: 5px 9px; min-width: 0; max-width: 220px; cursor: pointer; }
select:focus, input:focus, button:focus-visible { outline: 3px solid var(--yel); outline-offset: 0; }
.found { margin-left: auto; color: var(--sub); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- grid ---------- */
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 40px; scroll-behavior: smooth; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.ccard { background: var(--card); border: var(--edge); border-radius: 16px; box-shadow: var(--drop); padding: 7px 7px 9px;
         text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform .08s, background .12s; min-width: 0; }
.ccard:hover { transform: translateY(-2px); background: var(--card2); }
.ccard:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }
.ccard.boss { border-color: #7c2440; box-shadow: 0 4px 0 #7c2440; }
.ccard .art { aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: #f7efd8; }
.ccard .art img { width: 100%; height: 100%; object-fit: contain; }
.ccard .art .ph { font-size: 34px; font-weight: 800; color: var(--soft); }
.ccard .cname { font-size: 13px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.ccard .cmove { font-size: 11.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ccard .cmeta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: auto; }
.ccard .lv { font-size: 11px; font-weight: 800; color: var(--sub); font-variant-numeric: tabular-nums; }
.ccard .cprice { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; font-weight: 800;
                 color: var(--orange); font-variant-numeric: tabular-nums; min-width: 0; }
.ccard .cprice svg { width: 13px; height: 13px; flex: none; }
.ccard .cprice b { font-weight: 800; }
.ccard .cprice.guide { color: var(--sub); font-weight: 700; }
.ccard .rprices { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.ccard .rprices span { display: inline-flex; align-items: baseline; gap: 3px; font-size: 10.5px; font-weight: 800;
                       color: var(--orange); background: #fff4dd; border: 1.5px solid #ecd096; border-radius: 8px;
                       padding: 0 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ccard .rprices span b { color: var(--sub); font-size: 9px; }
.ccard .rprices span.g { color: var(--sub); background: #f6efdc; border-color: var(--soft); }

.elpill { display: inline-flex; align-items: center; gap: 5px; border: 2px solid var(--navy); border-radius: 999px; background: var(--card);
          padding: 0 7px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.elpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--navy); flex: none; }
.tag { font-size: 10.5px; font-weight: 800; padding: 0 7px; border-radius: 999px; border: 2px solid currentColor; white-space: nowrap; }
.tag.r { color: var(--red); } .tag.b { color: var(--blue); } .tag.g { color: var(--green); } .tag.s { color: var(--sub); }

.empty { padding: 60px 20px; text-align: center; color: var(--sub); font-weight: 700; font-size: 15px; }
.foot { margin-top: 28px; padding-top: 14px; border-top: 3px solid var(--soft); color: var(--sub); font-size: 11.5px; line-height: 1.7; text-align: center; }
.foot a { color: var(--blue); font-weight: 700; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14,23,48,.42); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 35; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100%); background: var(--bg); border-left: var(--edge);
          box-shadow: -6px 0 0 rgba(34,48,79,.18); transform: translateX(102%); transition: transform .2s ease; z-index: 40;
          display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 3px solid var(--navy); background: var(--navy); color: #fff; }
.drawer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c9d2ea; }
.drawer-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 30px; user-select: text; }

.btn { border: var(--edge); border-radius: 14px; padding: 8px 18px; background: var(--yel); color: var(--navy); font-weight: 800;
       font-size: 14px; box-shadow: var(--drop); cursor: pointer; white-space: nowrap; position: relative; top: 0; }
.btn:hover { background: var(--yel-l); }
.btn:active { top: 3px; box-shadow: 0 1px 0 var(--navy); }
.btn.small { font-size: 12.5px; padding: 4px 12px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.drawer-head .btn.small { background: var(--card2); color: var(--navy); }

.dhero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.dhero .pic { width: 148px; height: 148px; flex: none; border-radius: 14px; background: #f7efd8; border: var(--edge); box-shadow: var(--drop); overflow: hidden; }
.dhero .pic img { width: 100%; height: 100%; object-fit: contain; }
.dhero .pic .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; color: var(--soft); font-weight: 800; }
.dhero .info { flex: 1; min-width: 0; }
.dhero h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.25; }
.dhero .move { color: var(--blue); font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.dpills { display: flex; flex-wrap: wrap; gap: 6px; }
.dpills .pill { font-size: 11.5px; padding: 1px 10px; }

.panel { background: var(--card); border: var(--edge); border-radius: var(--r); box-shadow: var(--drop); padding: 12px 14px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.panel h3 .r { margin-left: auto; font-size: 11.5px; color: var(--sub); font-weight: 700; }
.panel p { margin: 0; line-height: 1.65; font-size: 13.5px; }
.muted { color: var(--sub); }
.hint { color: var(--sub); font-size: 12px; line-height: 1.6; margin-top: 8px; }

.pas-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pas-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.pas-list .tag { margin-top: 1px; flex: none; }

.power { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.power div { border: 2px solid var(--soft); border-radius: 8px; padding: 4px 2px; text-align: center; background: #fffef8; }
.power div.pk { border-color: var(--gold); background: var(--card2); }
.power small { display: block; font-size: 9px; color: var(--sub); font-weight: 700; }
.power b { font-size: 11px; font-variant-numeric: tabular-nums; }

.perks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.perks li { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.4; }
.perks b { flex: none; color: var(--gold); font-size: 11.5px; min-width: 40px; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.dl dt { color: var(--sub); font-weight: 700; white-space: nowrap; }
.dl dd { margin: 0; font-weight: 600; }
.coins { color: var(--orange); font-weight: 800; }
.chiprow { display: flex; flex-wrap: wrap; gap: 5px; }
.chiprow .chip { box-shadow: 0 2px 0 var(--navy); font-size: 11.5px; padding: 1px 9px; cursor: default; }
.chiprow .chip:hover { background: var(--card); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; font-size: 12.5px; }
.stats span { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1.5px solid #f1e8cc; padding: 2px 0; }
.stats b { font-variant-numeric: tabular-nums; }
.stats em { color: var(--sub); font-style: normal; }

.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.drops h4 { margin: 0 0 2px; font-size: 12px; color: var(--sub); }
.drops ul { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.65; }
.drops li { display: flex; justify-content: space-between; gap: 8px; }
.drops li b { font-variant-numeric: tabular-nums; color: var(--sub); font-weight: 700; flex: none; }

.offline-note { background: #fff3d1; border-color: var(--gold); }
.offline-note p { color: #7a5a00; }

.wiki-link { display: block; text-align: center; margin: 2px 0 8px; padding: 8px 12px; border: var(--edge); border-radius: 14px;
             background: var(--card); box-shadow: 0 3px 0 var(--navy); font-weight: 800; color: var(--blue); text-decoration: none; }
.wiki-link:hover { background: var(--card2); }
.wiki-link:active { box-shadow: none; transform: translateY(2px); }

/* ---------- runes ---------- */
.ccard.rune .rart { background: radial-gradient(circle at 50% 38%, #fffdf4, #efe2bf); }
.ccard.rune .rart img { width: 82%; height: 82%; object-fit: contain; }
.ccard.rune .cmove { min-height: 2.9em; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tagk { display: inline-flex; align-items: center; border: 2px solid var(--navy); border-radius: 999px; background: var(--c);
        color: #fff; font-size: 10.5px; font-weight: 800; padding: 0 7px; white-space: nowrap; line-height: 1.5; }
.tagk.lg { font-size: 11.5px; padding: 1px 10px; }
.rfits { font-size: 10.5px; font-weight: 800; color: var(--c, var(--sub)); border: 2px solid currentColor; border-radius: 999px;
         padding: 0 7px; white-space: nowrap; line-height: 1.45; }
.cnt { font-size: 10px; opacity: .75; font-weight: 800; }
.rpic { background: radial-gradient(circle at 50% 38%, #fffdf4, #efe2bf) !important; }
.rpic img { padding: 10%; object-fit: contain; }
.rtiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rtiers li { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 6px; border-bottom: 1.5px solid #f1e8cc; }
.rtiers li:last-child { border-bottom: 0; padding-bottom: 0; }
.rtiers img { width: 32px; height: 32px; flex: none; }
.rtiers b { flex: none; width: 24px; padding-top: 5px; color: var(--sub); font-size: 12px; }
.rtiers span { flex: 1; font-size: 13px; line-height: 1.5; }
.rtiers em { flex: none; font-style: normal; color: var(--orange); font-weight: 800; font-size: 12px; padding-top: 4px; white-space: nowrap; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.rgrid .panel { margin-bottom: 0; }
.rateTable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rateTable th, .rateTable td { text-align: left; padding: 4px 0; border-bottom: 1.5px solid #f1e8cc; }
.rateTable tr:last-child th, .rateTable tr:last-child td { border-bottom: 0; }
.rateTable th { color: var(--sub); font-weight: 700; }
.rateTable td { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rdrops { list-style: none; margin: 0; padding: 2px 8px; max-height: 310px; overflow-y: auto;
          border: 2px solid var(--soft); border-radius: 12px; }
.rdrops li { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; padding: 4px 0;
             border-bottom: 1.5px solid #f1e8cc; font-size: 12.5px; }
.rdrops li:last-child { border-bottom: 0; }
.rdrops .m { flex: 1; min-width: 0; line-height: 1.5; }
.rdrops .m b { font-weight: 700; }
.rdrops em { flex: none; font-style: normal; color: var(--orange); font-weight: 800; font-variant-numeric: tabular-nums; }
.rdrops small { color: var(--sub); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  html, body { height: auto; overflow: auto; }
  body { display: block; overflow: visible; }
  #rail { position: sticky; top: 0; z-index: 30; flex-direction: row; align-items: center; height: 58px; padding: 6px 10px; gap: 6px; overflow: visible; }
  .logo { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; margin: 0 4px 0 0; }
  .rail-btn { flex-direction: row; width: auto; gap: 6px; padding: 8px 12px; border-radius: 12px; }
  .rail-btn svg { width: 20px; height: 20px; }
  #rail .grow { flex: 1; }
  #main { height: auto; min-height: calc(100vh - 58px); }
  header { flex-wrap: wrap; padding: 12px 14px 6px; }
  .who { flex-basis: 100%; }
  .search { width: auto; flex: 1; max-width: none; }
  .filters { padding: 2px 14px 8px; }
  .content { overflow: visible; padding: 4px 14px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
  .drawer { width: 100%; }
  .dhero .pic { width: 110px; height: 110px; }
  .power { grid-template-columns: repeat(5, 1fr); }
  .stats, .drops { grid-template-columns: 1fr; }
  .rgrid { grid-template-columns: 1fr; }
}
