/* Holic 2 · zRedemption wiki — dark fantasy theme */
:root {
  --bg: #14100c;
  --bg2: #1b1611;
  --panel: #201a13;
  --panel2: #261f16;
  --border: #352b1e;
  --gold: #b08d57;
  --gold-soft: #d4b078;
  --text: #e8dfce;
  --muted: #9a8b70;
  --danger: #c0392b;
  --ok: #5b8a72;
  --link: #d4b078;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--gold) var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(176,141,87,.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--gold-soft); }
code { font-family: Consolas, "Cascadia Mono", monospace; }
h1, h2, h3 { font-weight: 600; letter-spacing: .3px; }

/* top bar */
.topbar {
  background: linear-gradient(#221b12, #1b1611);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #3a2f1d, #241c11);
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  color: var(--gold-soft); font: 700 17px Georgia, serif;
}
.brand-text { font: 600 17px Georgia, serif; letter-spacing: .4px; }
.brand-text small { display: block; font: 10px/1 system-ui; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }
.nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.nav a { color: #cfbf9d; font-size: 14px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--gold-soft); }
.nav a.active { color: var(--gold-soft); border-bottom-color: var(--gold); }
.nav .admin-link { color: #c78a5f; }
.nav-search { position: relative; flex: 0 1 340px; }
.nav-search input {
  width: 100%; padding: 8px 14px; border-radius: 8px;
  background: #131008; border: 1px solid var(--border); color: var(--text); outline: none;
}
.nav-search input:focus { border-color: var(--gold); }

/* search dropdown */
.search-drop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 90;
  background: var(--panel2); border: 1px solid var(--gold); border-radius: 8px;
  overflow: hidden; display: none; box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.search-drop.open { display: block; }
.search-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  color: var(--text); border-bottom: 1px solid #2c2417; cursor: pointer;
}
.search-item:hover { background: #2c2417; }
.search-item img { width: 28px; height: 28px; border-radius: 6px; }
.search-item small { color: var(--muted); margin-left: auto; }
.search-empty { padding: 10px 12px; color: var(--muted); }

/* subnav (admin) */
.subnav { background: #241b10; border-bottom: 1px solid var(--border); }
.subnav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 4px; align-items: center; overflow-x: auto;
}
.subnav a {
  color: #c9b68a; font-size: 13.5px; padding: 10px 12px; border-bottom: 2px solid transparent;
}
.subnav a.on { color: #f0a15e; border-bottom-color: #f0a15e; }
.subnav a:hover { color: #f0c07a; }
.logout-form { margin-left: auto; }
.linklike { background: none; border: none; color: var(--link); cursor: pointer; font: inherit; padding: 8px 4px; }
.linklike:hover { color: var(--gold-soft); text-decoration: underline; }

.content { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px 20px 60px; }

/* hero */
.hero {
  border: 1px solid var(--border); border-radius: 16px;
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(176,141,87,.18), transparent 70%),
    linear-gradient(160deg, #201a12, #17120b);
  padding: 46px 30px 36px; text-align: center; margin-bottom: 30px;
}
.hero h1 { margin: 0 0 6px; font: 700 40px Georgia, serif; color: var(--gold-soft); text-shadow: 0 2px 18px rgba(176,141,87,.35); }
.tagline { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.hero-search { position: relative; max-width: 560px; margin: 0 auto; display: flex; gap: 8px; }
.hero-search input {
  flex: 1; padding: 13px 18px; font-size: 16px; border-radius: 10px;
  background: #131008; border: 1px solid var(--border); color: var(--text); outline: none;
}
.hero-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,87,.15); }
.hero-search button {
  padding: 13px 26px; font-size: 15px; border-radius: 10px; border: 1px solid var(--gold);
  background: linear-gradient(#8a6b3f, #6b522f); color: #f3e9d2; font-weight: 600; cursor: pointer;
}
.hero-search button:hover { filter: brightness(1.15); }
.stat-strip { margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.stat-strip span {
  background: #241d12; border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; font-size: 13px; color: var(--gold-soft);
}

/* home cards */
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.home-card {
  display: block; padding: 22px; border-radius: 14px;
  background: linear-gradient(170deg, var(--panel), var(--bg2));
  border: 1px solid var(--border); transition: transform .15s, border-color .15s;
}
.home-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.home-card-icon { font-size: 30px; color: var(--gold); margin-bottom: 8px; }
.home-card h2 { margin: 0 0 6px; color: var(--gold-soft); font-family: Georgia, serif; }
.home-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.card-go { color: var(--gold); font-size: 13px; font-weight: 600; }

/* sections */
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin: 0; color: var(--gold-soft); font: 600 21px Georgia, serif; }
.section-head .hint, .muted { color: var(--muted); font-size: 13.5px; }
.more { margin-left: auto; font-size: 13.5px; }

/* icon grid */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.icon-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 10px 13px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color .15s, transform .15s;
}
.icon-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.icon-card img { width: 64px; height: 64px; border-radius: 14px; }
.icon-name { font-weight: 600; font-size: 14.5px; }
.icon-sub { color: var(--muted); font-size: 12.5px; }

/* zone strip */
.zone-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.zone-pill {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); border-left: 4px solid var(--zone, var(--gold));
}
.zone-pill:hover { border-color: var(--gold); }
.zone-pill small { color: var(--muted); margin-left: 6px; }

/* page head */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; color: var(--gold-soft); font: 700 30px Georgia, serif; }
.page-head p { margin: 0; color: var(--muted); }
.admin-head h1 { color: #f0a15e; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.filters label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.filters label.filter-check { flex-direction: row; align-items: center; gap: 7px; padding: 8px 0; }
.filters input[type="search"], .filters input[type="text"] { min-width: 190px; }
.filters select { max-width: min(320px, 82vw); }
.filters input:focus-visible, .filters select:focus-visible { border-color: var(--gold); outline: 2px solid rgba(218, 172, 92, .35); }
.filters input, .filters select {
  padding: 9px 12px; border-radius: 8px; background: #131008;
  border: 1px solid var(--border); color: var(--text); outline: none;
}
.filters input[type="number"] { width: 92px; }
.filters button {
  padding: 9px 18px; border-radius: 8px; border: 1px solid var(--gold);
  background: #3a2f1d; color: var(--gold-soft); cursor: pointer; font-weight: 600;
}
.filters button:hover { filter: brightness(1.2); }
.btn-ghost {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-ghost.small { padding: 5px 10px; font-size: 13px; }
.result-count { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.empty.small { padding: 12px; }

/* monster detail */
.monster-detail { display: grid; grid-template-columns: minmax(280px, 1fr) 380px; gap: 22px; margin-bottom: 34px; }
.monster-main {
  display: flex; gap: 24px; padding: 26px; border-radius: 16px;
  background: linear-gradient(160deg, var(--panel), var(--bg2)); border: 1px solid var(--border);
  align-items: flex-start;
}
.portrait { position: relative; flex: 0 0 auto; }
.portrait img { width: 132px; height: 132px; border-radius: 20px; border: 1px solid var(--border); }
.rarity-ribbon {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; color: #14100c;
  padding: 3px 12px; border-radius: 10px; white-space: nowrap;
}
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.monster-info h1 { margin: 0 0 12px; font: 700 32px Georgia, serif; }
.quick-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: #241d12; border: 1px solid var(--border); border-radius: 16px;
  padding: 4px 12px; font-size: 13px; color: #cfbf9d;
}
.chip-danger { border-color: #6d2f27; color: #e08a6e; }
.lore { color: #cbbfa5; font-size: 15px; font-style: italic; margin: 0; }

.stat-panel { padding: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); }
.stat-panel h2 { margin: 0 0 12px; color: var(--gold-soft); font: 600 18px Georgia, serif; }
.stat-table { width: 100%; border-collapse: collapse; }
.stat-table td { padding: 7px 0; border-bottom: 1px solid #2a2215; font-size: 14.5px; }
.stat-table td:first-child { color: var(--muted); }
.drops-head { margin-top: 20px; }
.drop-list { display: flex; flex-wrap: wrap; gap: 8px; }
.drop-pill {
  background: #1c2419; border: 1px solid #3b5537; color: #a8d6a0;
  padding: 4px 12px; border-radius: 14px; font-size: 13px;
}
.notes { color: #cbbfa5; font-size: 14px; margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); }
.data-table th {
  text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold-soft); padding: 11px 14px; background: #221b12; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #282013; font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #241d13; }
.mono { font-family: Consolas, monospace; color: #d9c89a; }
.mini-icon { width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; }
.monster-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.monster-link:hover { color: var(--gold-soft); }
.dim { color: var(--muted); font-size: 12.5px; }
.day-chip { font-size: 11.5px; padding: 2px 9px; border-radius: 10px; background: #241d12; border: 1px solid var(--border); }
.day-chip.night { background: #171b2a; border-color: #3a4268; color: #a9b4e0; }
.day-chip.day { background: #2a2414; border-color: #6b5a2a; color: #e0c873; }

/* zone tabs */
.zone-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.zone-tab {
  background: var(--panel); color: #cfbf9d; border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.zone-tab:hover { border-color: var(--gold); }
.zone-tab.on { background: #3a2f1d; border-color: var(--gold); color: var(--gold-soft); }

/* GM commands */
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-chip {
  padding: 6px 14px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--border); color: #cfbf9d; font-size: 13px;
}
.cat-chip.on { background: #3a2f1d; border-color: var(--gold); color: var(--gold-soft); }
.cmd-list { display: flex; flex-direction: column; gap: 10px; }
.cmd-row {
  display: grid; grid-template-columns: 300px 1fr auto; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px;
  transition: border-color .15s;
}
.cmd-row:hover { border-color: var(--gold); }
.cmd-left { display: flex; flex-direction: column; gap: 2px; }
.cmd-code { color: #7fd0b0; font-size: 15.5px; font-weight: 600; }
.cmd-args { color: #c9a06a; font-size: 12.5px; }
.cmd-desc p { margin: 0 0 4px; font-size: 14px; color: #d9cdb4; }
.cmd-example { color: var(--muted); font-size: 12.5px; }
.cmd-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rank-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; background: #332415;
  border: 1px solid #6b4d24; color: #e0b56e; padding: 2px 10px; border-radius: 10px;
}
.cat-tag { color: var(--muted); font-size: 12px; }
.copy-btn {
  background: #332a18; border: 1px solid var(--gold); color: var(--gold-soft);
  padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
}
.copy-btn:hover { filter: brightness(1.25); }

/* tooltip */
.tooltip {
  position: fixed; z-index: 200; width: 250px; pointer-events: none;
  background: #1b1510; border: 1px solid var(--gold); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 14px 44px rgba(0,0,0,.65);
}
.tooltip h4 { margin: 0 0 4px; font-size: 15px; }
.tooltip .tt-level { color: var(--muted); font-size: 12.5px; }
.tooltip .tt-stats { margin-top: 8px; font-size: 13px; color: #d9cdb4; }
.tooltip .tt-drops { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.tooltip .drop-pill { font-size: 11.5px; }
.tooltip .tt-desc { margin-top: 8px; font-size: 12.5px; color: #b3a68a; }

/* footer */
.footer { border-top: 1px solid var(--border); background: #17120b; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--muted); font-size: 13px;
}

/* ---------- admin ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: linear-gradient(170deg, var(--panel), var(--bg2)); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font: 700 34px Georgia, serif; color: var(--gold-soft); }
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-card a { font-size: 13px; color: #f0a15e; }

.notice {
  border: 1px solid #6b5a2a; background: #2a2414; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 22px; color: #e0c873; font-size: 14px;
}
.notice.success { border-color: #3b5537; background: #182317; color: #a8d6a0; }
.notice.error { border-color: #6d2f27; background: #271612; color: #e08a6e; }
.notice .inline-form { display: inline-block; margin-left: 10px; }

.btn-primary {
  display: inline-block; padding: 10px 22px; border-radius: 9px; border: 1px solid var(--gold);
  background: linear-gradient(#8a6b3f, #6b522f); color: #f3e9d2; font-weight: 600;
  cursor: pointer; font-size: 14.5px;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger {
  display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid #7a3a31;
  background: #3a1f19; color: #f0a08e; cursor: pointer; font-size: 13px;
}
.btn-danger:hover { filter: brightness(1.2); }
.btn-danger.small { padding: 4px 10px; font-size: 12.5px; }
.inline-form { display: inline; }
.inline { color: #f0a15e; }

.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.qa {
  padding: 10px 18px; border-radius: 10px; background: #2a2215; border: 1px solid var(--border);
  color: #d9cdb4; font-size: 14px;
}
.qa:hover { border-color: var(--gold); color: var(--gold-soft); }
.inbox-list { list-style: none; margin: 8px 0; padding: 0; }
.inbox-list li { padding: 6px 0; border-bottom: 1px solid #282013; font-size: 14px; color: #d9cdb4; }
.file-tag {
  font-size: 10.5px; font-weight: 700; background: #2a3524; color: #a8d6a0;
  border: 1px solid #3b5537; padding: 1px 6px; border-radius: 5px; margin-right: 6px;
}

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: #cfbf9d; }
.form-grid label.span2, .form-grid .span2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 9px 12px; border-radius: 8px; background: #131008;
  border: 1px solid var(--border); color: var(--text); outline: none; font: inherit;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--gold); }
.form-grid textarea { resize: vertical; }
.check-label { flex-direction: row !important; align-items: center; gap: 8px !important; padding-top: 22px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.saved-flag { color: var(--ok); font-weight: 600; }

.icon-editor { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.big-icon { width: 96px; height: 96px; border-radius: 16px; border: 1px solid var(--border); }
.icon-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.file-btn {
  display: inline-block; padding: 9px 18px; border-radius: 9px; border: 1px solid var(--gold);
  background: #332a18; color: var(--gold-soft); cursor: pointer; font-size: 14px;
}
.file-btn:hover { filter: brightness(1.2); }
.file-btn input { display: none; }

.spawn-editor input, .spawn-editor select {
  width: 100%; padding: 7px 9px; border-radius: 7px; background: #131008;
  border: 1px solid var(--border); color: var(--text); font: inherit; outline: none;
}
.spawn-editor td { padding: 8px 10px; }
.remove-spawn { padding: 4px 8px; }

/* GM edit modal */
.modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(8,6,4,.72);
  display: grid; place-items: center;
}
.modal-box {
  width: min(560px, 94vw); background: var(--panel); border: 1px solid var(--gold);
  border-radius: 14px; padding: 22px 24px;
}
.modal-box h2 { margin: 0 0 14px; color: var(--gold-soft); font: 600 19px Georgia, serif; }
.modal-actions { display: flex; gap: 10px; }

.row-actions { white-space: nowrap; }
.compact-form { align-items: end; }

.upload-box { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.format-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 14px; }
.format-cols h3 { margin: 0 0 8px; color: var(--gold-soft); font-size: 15px; }
.fmt {
  display: block; background: #131008; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: #7fd0b0; word-break: break-all;
}
.settings-form { max-width: 640px; }

/* login */
.login-wrap { display: grid; place-items: center; padding: 60px 0; }
.login-box {
  width: min(400px, 94vw); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 34px 32px; display: flex; flex-direction: column; gap: 14px;
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 14px;
  background: linear-gradient(135deg, #3a2f1d, #241c11); border: 1px solid var(--gold);
  display: grid; place-items: center; color: var(--gold-soft); font: 700 24px Georgia, serif;
}
.login-box h1 { margin: 0; text-align: center; color: var(--gold-soft); font: 600 22px Georgia, serif; }
.login-box p { margin: 0; text-align: center; }
.login-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: #cfbf9d; }
.login-box input {
  padding: 10px 12px; border-radius: 8px; background: #131008;
  border: 1px solid var(--border); color: var(--text); outline: none;
}
.login-box input:focus { border-color: var(--gold); }
.form-error { color: #e08a6e !important; font-size: 14px; }

@media (max-width: 900px) {
  .monster-detail { grid-template-columns: 1fr; }
  .home-cards, .dash-columns { grid-template-columns: 1fr; }
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-meta { flex-direction: row; align-items: center; }
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nav-search { flex: 1 1 100%; order: 2; }
  .monster-main { flex-direction: column; }
  .format-cols { grid-template-columns: 1fr; }
}

/* ---------- real-data additions ---------- */
.eyebrow {
  display: inline-block; color: var(--gold); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px;
}
.home-cards { grid-template-columns: repeat(4, 1fr); }
.home-card.studio-card { border-color: #4d3d5e; }
.home-card.studio-card .home-card-icon { color: #c9a6e8; }
.center { text-align: center; }
.small { font-size: 12.5px; }

/* pagination */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 24px 0 8px; flex-wrap: wrap;
}
.pager-info { color: var(--muted); font-size: 13.5px; }
.pager-info b { color: var(--gold-soft); }
.btn-ghost.disabled { opacity: .35; cursor: default; pointer-events: none; }

/* summon callout */
.summon-callout {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(127,208,176,.10), transparent 70%),
    linear-gradient(160deg, #1d241d, #17120b);
  border: 1px solid #3b5537; border-radius: 16px; padding: 22px 26px;
  margin-bottom: 26px; flex-wrap: wrap;
}
.summon-callout h2 { margin: 2px 0 6px; color: #a8d6a0; font: 600 24px Georgia, serif; }
.summon-callout h2 code { color: #7fd0b0; }
.summon-callout p { margin: 0; color: #b8c7ae; max-width: 720px; }
.summon-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.summon-actions .cmd-code {
  background: #10150f; border: 1px solid #3b5537; border-radius: 8px;
  padding: 9px 14px; font-size: 16px;
}
.summon-section { margin-top: 0; }
.zone-summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }

/* command cards, two-column layout */
.cmd-row { grid-template-columns: minmax(0, 1fr) auto; }
.cmd-example { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cmd-example .cmd-code {
  background: #10150f; border: 1px solid #2c3b2a; border-radius: 8px; padding: 7px 12px;
}
.copy-btn.copied { background: #2c4a2c; border-color: #7fd0b0; color: #c9f0d8; }
.icon-card .rank-badge { margin-top: 2px; }

/* studio */
.studio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.studio-card-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
}
.studio-card-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0d0b08; }
.studio-card-body { padding: 14px 16px 16px; }
.studio-card-body h3 { margin: 0 0 4px; color: var(--gold-soft); font-family: Georgia, serif; }
.studio-card-body p { margin: 0; color: var(--muted); font-size: 13.5px; }
.studio-hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 22px;
  align-items: stretch; margin-bottom: 30px;
}
.studio-hero-copy {
  background: linear-gradient(160deg, #241a2c, #17120b); border: 1px solid #4d3d5e;
  border-radius: 16px; padding: 28px;
}
.studio-hero-copy h1 { margin: 0 0 10px; color: #d8c2f0; font: 700 34px Georgia, serif; }
.studio-hero-copy p { color: #c6b6d6; }
.studio-hero-image { border-radius: 16px; overflow: hidden; border: 1px solid #4d3d5e; }
.studio-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.viewer-shell {
  position: relative; border: 1px solid #4d3d5e; border-radius: 16px; overflow: hidden;
  background: radial-gradient(700px 350px at 50% 20%, #2a2136, #0d0b08 70%);
  min-height: 480px;
}
.viewer-shell canvas { display: block; width: 100%; height: 480px; }
.viewer-hint {
  position: absolute; left: 14px; bottom: 12px; color: #b9a9ca; font-size: 12.5px;
  background: rgba(13,11,8,.65); border: 1px solid #4d3d5e; border-radius: 8px; padding: 5px 10px;
}
.viewer-loading {
  position: absolute; inset: 0; display: grid; place-items: center; color: #c9a6e8;
  font-size: 14px; letter-spacing: 1px;
}
.model-switcher { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.model-switcher button {
  background: var(--panel); border: 1px solid var(--border); color: #cfbf9d;
  border-radius: 9px; padding: 7px 14px; cursor: pointer; font-size: 13.5px;
}
.model-switcher button.on { border-color: #9d7bc0; color: #d8c2f0; background: #2a2136; }

@media (max-width: 980px) {
  .home-cards { grid-template-columns: repeat(2, 1fr); }
  .studio-hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .home-cards { grid-template-columns: 1fr; }
}

/* ---------- studio page ---------- */
.studio-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px;
  padding: 0; margin: 20px 0 16px;
}
.studio-facts li { color: #c6b6d6; font-size: 13px; }
.studio-facts b {
  display: block; color: #ecdff9; font: 700 24px Georgia, serif; line-height: 1.15;
}
.studio-note {
  font-size: 12.5px !important; color: #a898b8 !important;
  border-top: 1px solid #3a2d47; padding-top: 14px; margin-top: 6px !important;
}
.studio-note code { color: #d8c2f0; font-size: 11.5px; }
.studio-hero-image { position: relative; background: #08060b; min-height: 280px; }
.studio-hero-image img { object-fit: contain; }
.studio-hero-tag {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  background: rgba(13, 11, 8, .8); border: 1px solid #6a5480; border-radius: 999px;
  padding: 6px 13px; font-size: 12px; color: #e2cff5; letter-spacing: .4px;
  backdrop-filter: blur(4px);
}

.studio-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px; align-items: start; margin-bottom: 40px;
}
.studio-viewer-col { min-width: 0; }
.viewer-shell { min-height: 540px; }
.viewer-shell canvas { height: 540px; }
.viewer-shell.ready .viewer-loading { display: none; }
.viewer-loading {
  z-index: 2; background: rgba(13, 11, 8, .5); backdrop-filter: blur(2px);
  letter-spacing: 1.4px; text-transform: uppercase; font-size: 11.5px;
}
.viewer-loading[hidden], .viewer-error[hidden] { display: none; }
.viewer-error {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center;
  gap: 14px; text-align: center; padding: 24px; background: rgba(13, 11, 8, .94);
}
.viewer-error p { margin: 0; color: #e0b3a0; }
.viewer-error img {
  max-height: 330px; max-width: 100%; margin: 0 auto;
  border-radius: 12px; border: 1px solid #4d3d5e;
}
.viewer-toolbar {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.viewer-toolbar button {
  background: rgba(20, 16, 26, .82); border: 1px solid #55406b; color: #d8c9ea;
  border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer;
  backdrop-filter: blur(4px);
}
.viewer-toolbar button:hover { border-color: #a681cf; color: #f2e8ff; }
.viewer-toolbar button:disabled { opacity: .45; cursor: default; }
.viewer-toolbar button[aria-pressed="true"] {
  border-color: #9d7bc0; color: #f2e8ff; background: rgba(55, 40, 74, .9);
}

.model-switcher {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 12px;
}
.model-switcher button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; color: inherit; cursor: pointer; font: inherit;
}
.model-switcher button img {
  width: 46px; height: 46px; border-radius: 7px; object-fit: cover;
  flex: none; background: #0d0b08;
}
.model-switcher button span { display: flex; flex-direction: column; min-width: 0; }
.model-switcher button b {
  font-size: 12.5px; color: #d8c9ea; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.model-switcher button small { font-size: 11px; color: var(--muted); }
.model-switcher button.on {
  border-color: #9d7bc0; background: #2a2136; box-shadow: inset 0 0 0 1px #6a5480;
}

.studio-side {
  background: linear-gradient(170deg, #241a2c, #18120f);
  border: 1px solid #4d3d5e; border-radius: 16px; padding: 22px 22px 20px;
  position: sticky; top: 84px;
}
.studio-side h2 { margin: 4px 0 8px; color: #e2cff5; font: 700 25px Georgia, serif; }
.studio-side > p { color: #bfaed2; font-size: 14px; margin: 0 0 18px; }
.studio-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.studio-meta div {
  background: rgba(13, 11, 8, .45); border: 1px solid #3a2d47;
  border-radius: 9px; padding: 8px 10px;
}
.studio-meta dt {
  color: #9f8bb4; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px;
}
.studio-meta dd { margin: 2px 0 0; color: #eadff7; font-size: 14px; }
.studio-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.studio-tags .chip { border-color: #5d4774; color: #d8c2f0; background: #2a2136; }
.studio-source { border-top: 1px solid #3a2d47; padding-top: 12px; margin-bottom: 16px; }
.studio-source summary { cursor: pointer; color: #c9a6e8; font-size: 13px; }
.studio-source p { margin: 10px 0 4px; }
.studio-source code {
  display: block; background: #120f18; border: 1px solid #3a2d47; border-radius: 6px;
  padding: 6px 8px; font-size: 11px; color: #9ecfb7;
  word-break: break-all; margin-bottom: 4px;
}

.studio-gallery-section { margin-top: 8px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-head h2 { margin: 2px 0 0; color: var(--gold-soft); font: 600 26px Georgia, serif; }
.section-head p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 460px; }
.studio-card-item { margin: 0; }
.studio-card-item a { display: block; overflow: hidden; }
.studio-card-item img { aspect-ratio: 1 / 1; }
.studio-card-item img { transition: transform .35s ease, filter .35s ease; }
.studio-card-item a:hover img { transform: scale(1.035); filter: brightness(1.12); }
.studio-card-body h3 { font-size: 15px; margin: 8px 0 0; }

.viewer-shell:fullscreen {
  border: 0; border-radius: 0;
  background: radial-gradient(900px 520px at 50% 20%, #2a2136, #0d0b08 70%);
}
.viewer-shell:fullscreen canvas { height: 100vh; }
.viewer-shell:fullscreen .viewer-toolbar { bottom: 20px; right: 20px; }
.viewer-shell:fullscreen .viewer-hint { bottom: 20px; left: 20px; }

@media (max-width: 980px) {
  .studio-stage { grid-template-columns: 1fr; }
  .studio-side { position: static; }
  .model-switcher { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .viewer-shell { min-height: 400px; }
  .viewer-shell canvas { height: 400px; }
  .viewer-toolbar { left: 12px; right: 12px; justify-content: center; }
  .viewer-hint { display: none; }
}
