:root {
    color-scheme: dark;
    --bg: #0a0b0d;
    --bg-top: #151517;
    --sidebar: rgba(9, 10, 12, .94);
    --panel: rgba(22, 22, 23, .88);
    --panel-2: rgba(17, 17, 18, .92);
    --control: rgba(19, 19, 20, .88);
    --control-strong: rgba(38, 18, 20, .92);
    --line: rgba(255, 255, 255, .11);
    --line-strong: rgba(201, 49, 61, .44);
    --text: #f3f0ea;
    --muted: #a9a39a;
    --gold: #d9a64a;
    --blue: #9eb9dc;
    --red: #f0525d;
    --green: #8fd29b;
    --violet: #c4a8ff;
    --accent: #a51e29;
    --accent-2: #d6a450;
    --accent-text: #ff5966;
    --table-head: rgba(20, 20, 21, .96);
    --row-hover: rgba(159, 29, 40, .12);
    --tag-bg: rgba(145, 31, 39, .58);
    --shadow: rgba(0, 0, 0, .46);
    --watermark: rgba(217, 166, 74, .08);
    --input-placeholder: #79736b;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #faf9f6;
    --bg-top: #ffffff;
    --sidebar: rgba(255, 255, 255, .92);
    --panel: rgba(255, 255, 255, .88);
    --panel-2: rgba(253, 250, 245, .92);
    --control: rgba(255, 255, 255, .88);
    --control-strong: rgba(246, 234, 215, .96);
    --line: rgba(88, 70, 50, .14);
    --line-strong: rgba(192, 144, 75, .38);
    --text: #251f1b;
    --muted: #71685f;
    --gold: #c7903c;
    --blue: #607da3;
    --red: #b82631;
    --green: #4f9867;
    --violet: #7659b8;
    --accent: #c79750;
    --accent-2: #d6ae68;
    --accent-text: #b82631;
    --table-head: rgba(255, 255, 255, .96);
    --row-hover: rgba(208, 161, 91, .12);
    --tag-bg: rgba(240, 224, 199, .92);
    --shadow: rgba(111, 84, 50, .12);
    --watermark: rgba(199, 144, 60, .10);
    --input-placeholder: #a49a90;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font: 14px/1.45 "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #102949 0%, #071827 42%, #07111d 100%);
}
a { color: #9fd1ff; text-decoration: none; }
a:hover { color: white; }
code { color: #ffd98e; }

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; min-width: 0; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: rgba(7, 16, 29, .94);
    border-right: 1px solid var(--line);
    min-width: 0;
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); margin-bottom: 22px; }
.brand-mark {
    width: 44px; height: 44px; display: grid; place-items: center;
    border: 1px solid #9f7930; color: #ffe6a8;
    background: linear-gradient(145deg, #5a3e12, #10233a);
    font-weight: 800; border-radius: 8px;
}
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.side-search { display: grid; gap: 8px; margin-bottom: 18px; }
input, select, button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #10233a;
    color: var(--text);
    padding: 10px 12px;
    min-width: 0;
}
button {
    cursor: pointer;
    background: linear-gradient(180deg, #c59a42, #75521d);
    color: #fff8e6;
    font-weight: 700;
}
button:hover { border-color: var(--gold); }
nav { display: grid; gap: 6px; }
nav a {
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 8px;
}
nav a.active, nav a:hover {
    color: white;
    background: #122a46;
}
.content { padding: 28px; min-width: 0; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 20px;
}
.page-head > div {
    min-width: 0;
}
.page-head p {
    overflow-wrap: anywhere;
}
h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: 0; }
h2 { font-size: 17px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--gold); }
p { color: #dce3ee; }
.page-head p, .muted { color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.section-card {
    display: grid;
    gap: 6px;
    min-height: 112px;
    align-content: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #132b47, #0e2036);
    color: var(--text);
}
.section-card:hover { border-color: var(--gold); background: #183557; }
.section-card strong { font-size: 18px; }
.section-card span { color: var(--muted); }
.stat-card, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 55px var(--shadow);
}
.stat-card { padding: 18px; }
.stat-card span, .stat-card small { color: var(--muted); display: block; }
.stat-card strong { display: block; color: var(--gold); font-size: 28px; margin: 6px 0 2px; }
.panel { padding: 18px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 10px; margin-bottom: 14px; }
.filters.compact { grid-template-columns: minmax(220px, 1fr) auto; }
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #314b6d;
    border-radius: 8px;
    color: #cedcf0;
    background: #10233a;
}
.tabs a.active, .tabs a:hover {
    color: #fff8e6;
    border-color: var(--gold);
    background: #173556;
}
.table-wrap { overflow: auto; border: 1px solid #314b6d; border-radius: 8px; }
.items-browser.view-all .table-wrap,
.items-browser.view-all .item-table-scroll {
    max-height: calc(100vh - 285px);
    min-height: 360px;
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #27405f; vertical-align: top; }
th {
    text-align: left;
    color: #dbe7f8;
    background: #162f4d;
    position: sticky;
    top: 0;
    z-index: 1;
}
tr:nth-child(even) td { background: rgba(255,255,255,.018); }
tr:hover td { background: rgba(240,200,106,.08); }
.tag {
    display: inline-flex;
    align-items: center;
    min-width: 34px;
    justify-content: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    background: #1b3656;
    color: #cbd6e7;
}
.tag-blue { color: var(--blue); }
.tag-violet { color: var(--violet); }
.tag-green { color: var(--green); }
.tag-gold { color: var(--gold); }
.tag-red { color: var(--red); }
.tag-muted { color: var(--muted); }
.item-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f2f6fb;
    font-weight: 700;
}
.item-link:hover { color: #ffe29b; }
.item-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    image-rendering: auto;
    border: 1px solid #8b6a2b;
    border-radius: 6px;
    background: #0a1829;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.monster-list-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 270px;
}
.monster-list-copy {
    min-width: 0;
}
.monster-list-name {
    color: var(--text);
    font-weight: 900;
}
.monster-list-name:hover {
    color: var(--gold);
}
.monster-mini-model {
    position: relative;
    flex: 0 0 88px;
    width: 88px;
    height: 74px;
}
.monster-mini-stage {
    width: 88px;
    height: 74px;
    min-height: 74px;
    overflow: visible;
    border: 0;
    border-radius: 6px;
    background: transparent !important;
}
.monster-mini-stage .morph-canvas {
    pointer-events: none;
    touch-action: auto;
}
.monster-mini-model.is-three-ready .morph-canvas {
    opacity: 1;
}
.monster-mini-model.is-three-ready .morph-stage-fallback {
    display: none;
}
.monster-mini-stage-fallback {
    background: transparent !important;
}
.monster-mini-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0;
}
.monster-mini-fallback img {
    max-width: 74px;
    max-height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(0,0,0,.42));
}
.monster-mini-fallback strong {
    display: grid;
    place-items: center;
    width: 42px;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--gold);
    background: var(--control);
    font-size: 15px;
}
.item-title {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}
.item-title .item-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: white; }
.description { white-space: normal; color: #e5ebf3; }
.item-summary {
    color: #dbe5f1;
    min-width: 260px;
}
.clean-list { margin: 0; padding-left: 18px; color: #dce3ee; }
.code-line {
    font-family: Consolas, monospace;
    color: #cfe4ff;
    background: #0d1d31;
    border: 1px solid #304b6d;
    border-radius: 8px;
    padding: 12px;
}
.ok { color: var(--green); font-weight: 700; }
.bad { color: var(--red); font-weight: 700; }
.error {
    white-space: pre-wrap;
    color: #ffd0d0;
    background: #241417;
    border: 1px solid #66343a;
    border-radius: 8px;
    padding: 14px;
}
.location-monsters {
    display: grid;
    gap: 10px;
}
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}
.location-card {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 12px;
    min-height: 112px;
    padding: 10px;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(165, 30, 41, .14), transparent 68%),
        var(--control);
    color: var(--text);
    overflow: hidden;
}
.location-card:hover {
    border-color: var(--line-strong);
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(165, 30, 41, .24), transparent 68%),
        var(--control-strong);
}
html[data-theme="light"] .location-card {
    background:
        linear-gradient(135deg, rgba(217, 174, 102, .20), transparent 68%),
        var(--control);
}
.location-thumb {
    width: 94px;
    height: 92px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    background: #0a1829;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.location-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--gold);
    font-weight: 900;
    background:
        linear-gradient(135deg, rgba(217, 166, 74, .18), rgba(165, 30, 41, .14)),
        var(--panel-2);
}
.location-card-body {
    min-width: 0;
    display: grid;
    gap: 5px;
    align-content: center;
}
.location-card strong {
    font-size: 16px;
    line-height: 1.25;
}
.location-card span {
    color: var(--muted);
}
.location-card em {
    color: var(--accent-2);
    font-style: normal;
    font-weight: 800;
}
.location-hero {
    display: grid;
    grid-template-columns: minmax(260px, 430px) minmax(0, 1fr);
    min-height: 240px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(165, 30, 41, .18), transparent 62%),
        var(--panel);
    box-shadow: 0 18px 55px var(--shadow);
}
.location-hero-image {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    background: var(--panel-2);
}
.location-hero-empty {
    display: grid;
    place-items: center;
    color: var(--gold);
    font-size: 34px;
    font-weight: 900;
    background:
        linear-gradient(135deg, rgba(217, 166, 74, .18), rgba(165, 30, 41, .12)),
        var(--panel-2);
}
.location-hero-copy {
    display: grid;
    gap: 8px;
    align-content: center;
    padding: 24px;
}
.location-hero-copy span {
    color: var(--gold);
    font-weight: 800;
}
.location-hero-copy strong {
    font-size: 28px;
    line-height: 1.15;
}
.location-hero-copy p {
    margin: 0;
    color: var(--text);
}
.location-hero-copy em {
    color: var(--muted);
    font-style: normal;
}
.wiki-location-info {
    background:
        radial-gradient(circle at 8% 0, rgba(217, 166, 74, .10), transparent 30%),
        linear-gradient(135deg, rgba(165, 30, 41, .10), transparent 58%),
        var(--panel);
}
.wiki-location-text {
    display: grid;
    gap: 8px;
    max-width: 940px;
    margin-bottom: 14px;
}
.wiki-location-text p {
    margin: 0;
    color: var(--text);
}
.wiki-location-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.wiki-location-highlights article,
.wiki-location-rules article,
.wiki-location-rewards article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}
.wiki-location-highlights article {
    padding: 12px;
}
.wiki-location-highlights span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.wiki-location-highlights strong {
    display: block;
    margin-top: 4px;
    color: var(--gold);
    font-size: 18px;
}
.wiki-location-rules,
.wiki-location-rewards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.wiki-location-rules article,
.wiki-location-rewards article {
    padding: 14px;
}
.wiki-location-rules h3,
.wiki-location-rewards h3 {
    margin-top: 0;
}
.wiki-location-rules ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 18px;
    color: var(--text);
}
.wiki-location-rewards article > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.wiki-reward-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    max-width: 280px;
    padding: 5px 8px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(217, 166, 74, .10), transparent 70%),
        var(--panel-2);
    color: var(--text);
}
.wiki-reward-chip:hover {
    border-color: var(--line-strong);
    color: var(--gold);
}
.wiki-reward-chip .item-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}
.wiki-reward-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wiki-reward-chip small {
    color: var(--gold);
    white-space: nowrap;
}
.wiki-location-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.wiki-location-gallery figure {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}
.wiki-location-gallery img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    background: var(--panel-2);
}
.wiki-location-gallery figcaption {
    color: var(--muted);
    font-size: 12px;
}
.wiki-floor-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.wiki-floor-tabs a {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--control);
    font-weight: 800;
}
.wiki-floor-tabs a.active,
.wiki-floor-tabs a:hover {
    color: #fff4e4;
    border-color: var(--line-strong);
    background:
        linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82)),
        var(--control-strong);
}
html[data-theme="light"] .wiki-floor-tabs a.active,
html[data-theme="light"] .wiki-floor-tabs a:hover {
    color: #fffaf1;
    background:
        linear-gradient(180deg, #d7ad68, #bd8840),
        var(--control-strong);
}
.wiki-monster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.wiki-monster-drops {
    grid-template-columns: 1fr;
}
.wiki-monster-card {
    min-width: 0;
    color: var(--text);
}
.wiki-monster-card:hover {
    border-color: var(--line-strong);
    background: var(--control-strong);
}
.wiki-monster-card .monster-title > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}
.wiki-monster-card .monster-title .monster-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wiki-monster-card .monster-mini-model {
    margin: -8px 0;
}
.wiki-monster-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.wiki-monster-meta span {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
}
.monster-drop-row {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 14px;
    align-items: start;
    padding: 12px;
    border: 1px solid #314b6d;
    border-radius: 8px;
    background: #10233a;
}
.monster-drop-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}
.monster-drop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.monster-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}
.monster-title small {
    display: block;
    color: var(--muted);
}
.monster-portrait {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #0a1829;
}
.monster-portrait-empty {
    display: grid;
    place-items: center;
    color: var(--gold);
    font-weight: 900;
    background:
        linear-gradient(135deg, rgba(217, 166, 74, .18), rgba(165, 30, 41, .14)),
        var(--panel-2);
}
.monster-drop-head span {
    color: var(--accent-2);
    font-weight: 800;
    white-space: nowrap;
}
.monster-name {
    display: block;
    font-weight: 800;
    color: white;
    margin-bottom: 2px;
}
.monster-drop-row span {
    color: var(--muted);
}
.drop-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.drop-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 320px;
    min-height: 38px;
    padding: 5px 8px 5px 5px;
    border: 1px solid #3f5d82;
    border-radius: 8px;
    background: #162f4d;
    color: #e7eef8;
}
.drop-chip .item-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}
.drop-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
}
.drop-chip small {
    color: var(--muted);
    white-space: nowrap;
}
.drop-chip em {
    color: var(--gold);
    font-style: normal;
    font-size: 12px;
}
.drop-more {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #173556;
}

.morph-browser {
    overflow: hidden;
}

.morph-search {
    margin-bottom: 10px;
}

.morph-browser-grid {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.morph-book-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 315px);
    min-height: 500px;
    overflow: auto;
    padding-right: 6px;
}

.morph-book {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(165, 30, 41, .10), transparent 68%),
        var(--control);
    color: var(--text);
}

.morph-book:hover,
.morph-book.active {
    border-color: var(--line-strong);
    background:
        linear-gradient(180deg, rgba(185, 38, 49, .28), rgba(106, 24, 31, .20)),
        var(--control-strong);
}

html[data-theme="light"] .morph-book:hover,
html[data-theme="light"] .morph-book.active {
    background:
        linear-gradient(180deg, rgba(215, 173, 104, .28), rgba(189, 136, 64, .18)),
        var(--control-strong);
}

.morph-book span {
    min-width: 0;
}

.morph-book strong,
.morph-book small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.morph-book strong {
    color: var(--text);
}

.morph-book small {
    color: var(--muted);
    margin-top: 2px;
}

.morph-book em {
    color: var(--accent-2);
    font-style: normal;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.morph-viewer-wrap {
    display: grid;
    grid-template-columns: minmax(390px, .9fr) minmax(280px, 410px);
    gap: 16px;
    align-items: start;
    min-height: 0;
}

@media (max-width: 1320px) {
    .morph-viewer-wrap {
        grid-template-columns: 1fr;
    }
}

.morph-stage {
    position: relative;
    height: clamp(360px, 56vh, 540px);
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 18%, rgba(217, 166, 74, .18), transparent 28%),
        radial-gradient(circle at 50% 72%, rgba(165, 30, 41, .18), transparent 34%),
        linear-gradient(180deg, rgba(18, 18, 20, .86), rgba(7, 8, 10, .94));
}

html[data-theme="light"] .morph-stage {
    background:
        radial-gradient(circle at 50% 18%, rgba(215, 173, 104, .24), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,.82), rgba(247, 241, 231, .92));
}

.morph-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    touch-action: none;
    transition: opacity .18s ease;
}

.morph-zoom-controls {
    position: absolute;
    z-index: 6;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--control) 88%, transparent);
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
    backdrop-filter: blur(10px);
}

.morph-zoom-controls button {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 32px;
    padding: 0 9px;
    border-color: var(--line);
    border-radius: 7px;
    color: var(--text);
    background: var(--panel-2);
    font-weight: 900;
    line-height: 1;
}

.morph-zoom-controls button:hover {
    border-color: var(--line-strong);
    color: #fff4e4;
    background: linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82));
}

.morph-zoom-controls [data-morph-zoom="reset"] {
    min-width: 58px;
    font-size: 12px;
}

.morph-position-controls {
    display: grid;
    gap: 4px;
    justify-items: stretch;
}

.morph-pan-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.morph-pan-buttons button {
    min-width: 0;
    width: 100%;
    height: 24px;
    padding: 0;
    font-size: 13px;
}

html[data-theme="light"] .morph-zoom-controls {
    background: color-mix(in srgb, var(--control) 92%, transparent);
}

html[data-theme="light"] .morph-zoom-controls button:hover {
    color: #fffaf1;
    background: linear-gradient(180deg, #d7ad68, #bd8840);
}

.morph-effect-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    mix-blend-mode: screen;
}

.morph-effect-ambient {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 999px;
    border: 1px solid rgba(222, 59, 72, .42);
    background:
        radial-gradient(circle, rgba(255, 74, 94, .20), transparent 56%),
        conic-gradient(from 0deg, transparent, rgba(224, 59, 75, .42), transparent, rgba(221, 166, 78, .35), transparent);
    filter: blur(.2px);
    opacity: .42;
    transform: translate(-50%, -50%) scale(var(--effect-scale, 1));
    animation: morphAmbientSpin 5.8s linear infinite, morphAmbientPulse 2.4s ease-in-out infinite alternate;
}

.morph-effect-ambient:nth-child(2) {
    --effect-scale: .62;
    top: 42%;
    opacity: .30;
    animation-duration: 4.6s, 2.1s;
    animation-direction: reverse, alternate;
}

.morph-effect-burst {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 48%);
    width: var(--size, 150px);
    aspect-ratio: 1;
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(255, 245, 195, .95) 0 7%, rgba(255, 70, 86, .58) 8% 28%, rgba(210, 36, 56, .18) 42%, transparent 68%);
    transform: translate(-50%, -50%) scale(.2);
    opacity: 0;
    animation: morphEffectBurst .72s ease-out forwards;
}

.morph-effect-burst::after {
    content: "";
    position: absolute;
    inset: 17%;
    border-radius: inherit;
    border: 1px solid rgba(255, 204, 110, .64);
    transform: rotate(22deg);
}

@keyframes morphAmbientSpin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

@keyframes morphAmbientPulse {
    from { opacity: .22; transform: translate(-50%, -50%) scale(calc(var(--effect-scale, 1) * .92)); }
    to { opacity: .50; transform: translate(-50%, -50%) scale(calc(var(--effect-scale, 1) * 1.08)); }
}

@keyframes morphEffectBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.18); filter: blur(1px); }
    18% { opacity: .95; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); filter: blur(5px); }
}

.morph-reference-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    filter: contrast(1.04) saturate(1.06);
    transition: opacity .18s ease, transform .35s ease;
}

.morph-viewer-wrap:not(.is-three-ready) .morph-reference-image {
    transform: translateY(var(--morph-pan-y, 0px)) scale(var(--morph-zoom, 1));
}

.morph-viewer-wrap.is-three-ready .morph-canvas {
    opacity: 1;
}

.morph-viewer-wrap.is-reference-ready .morph-reference-image {
    opacity: 1;
}

.morph-viewer-wrap.is-reference-ready .morph-canvas,
.morph-viewer-wrap.is-reference-ready .morph-stage-fallback {
    display: none;
}

.morph-viewer-wrap.is-reference-animated .morph-reference-image {
    animation: morphReferenceIdle 4.2s ease-in-out infinite alternate;
}

.morph-stage-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: var(--text);
    transform: translateY(var(--morph-pan-y, 0px));
}

.morph-viewer-wrap.is-three-ready .morph-stage-fallback {
    display: none;
}

.morph-asset-stage,
.morph-texture-orbit {
    display: grid;
    place-items: center;
}

.morph-texture-orbit {
    --turn: 0deg;
    position: relative;
    width: min(430px, 78vw);
    height: min(360px, 56vw);
    min-height: 260px;
    transform: rotateY(var(--turn));
    transform-style: preserve-3d;
    transition: transform .18s ease;
    cursor: grab;
    scale: var(--morph-zoom, 1);
}

.morph-texture-orbit:active {
    cursor: grabbing;
}

.morph-viewer-wrap.is-rotating .morph-texture-orbit {
    animation: morphTextureTurn 8s linear infinite;
}

.morph-texture-card {
    position: absolute;
    width: min(255px, 55vw);
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel-2);
    box-shadow: 0 22px 70px rgba(0,0,0,.44);
    transform: translateX(var(--x, 0)) translateY(var(--y, 0)) rotate(var(--r, 0deg)) scale(var(--s, .78));
    opacity: .82;
}

.morph-texture-card.main {
    --s: 1;
    z-index: 6;
    opacity: 1;
}

.morph-texture-card:nth-child(2) { --x: -118px; --y: 20px; --r: -8deg; z-index: 4; }
.morph-texture-card:nth-child(3) { --x: 118px; --y: 24px; --r: 8deg; z-index: 4; }
.morph-texture-card:nth-child(4) { --x: -72px; --y: -76px; --r: 6deg; z-index: 3; }
.morph-texture-card:nth-child(5) { --x: 74px; --y: -76px; --r: -6deg; z-index: 3; }
.morph-texture-card:nth-child(6) { --x: 0; --y: 94px; --r: 3deg; z-index: 2; }

.morph-viewer-wrap[data-motion*="WALK"] .morph-texture-orbit,
.morph-viewer-wrap[data-motion*="RUN"] .morph-texture-orbit {
    animation-duration: 4.8s;
}

.morph-viewer-wrap[data-motion*="ATTACK"] .morph-texture-card.main,
.morph-viewer-wrap[data-motion*="SKILL"] .morph-texture-card.main,
.morph-viewer-wrap[data-motion*="SPELL"] .morph-texture-card.main {
    animation: morphTexturePulse 1.1s ease-in-out infinite alternate;
}

@keyframes morphTextureTurn {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes morphTexturePulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.18) saturate(1.12); }
}

@keyframes morphReferenceIdle {
    from { transform: scale(1.01) translateY(0); }
    to { transform: scale(1.045) translateY(-6px); }
}

.morph-texture-preview {
    width: min(240px, 58vw);
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel-2);
    box-shadow: 0 18px 55px var(--shadow);
}

.morph-texture-empty {
    display: grid;
    place-items: center;
    color: var(--accent-2);
    font-weight: 900;
    font-size: 38px;
}

.morph-side {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.morph-side .item-title {
    margin-bottom: 0;
}

.morph-side .item-title h2 {
    margin: 0 0 3px;
}

.morph-side .item-title p {
    margin: 0;
    color: var(--muted);
}

.morph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
    padding-right: 4px;
}

.morph-actions button {
    min-height: 36px;
    padding: 8px 11px;
    border-color: var(--line);
    background: var(--control);
    color: var(--text);
}

.morph-actions button.active,
.morph-actions button:hover {
    border-color: var(--line-strong);
    color: #fff4e4;
    background: linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82));
}

html[data-theme="light"] .morph-actions button.active,
html[data-theme="light"] .morph-actions button:hover {
    color: #fffaf1;
    background: linear-gradient(180deg, #d7ad68, #bd8840);
}

.morph-tech-note {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.morph-tech-note span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: var(--panel-2);
}

.morph-kit-panel {
    display: grid;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.morph-kit-panel h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
}

.morph-kit-list {
    display: grid;
    gap: 6px;
}

.morph-kit-list span,
.morph-animation-current {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--control);
}

.morph-kit-list strong,
.morph-animation-current strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
}

.morph-kit-list small,
.morph-animation-current span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.morph-animation-current {
    border-color: var(--line-strong);
    background:
        linear-gradient(135deg, rgba(185, 38, 49, .18), transparent 72%),
        var(--control);
}

.monster-profile-grid {
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(280px, .7fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.monster-model-panel,
.monster-stats-panel {
    margin-bottom: 0;
}

.monster-model-showcase {
    display: grid;
    gap: 0;
}

.monster-model-stage {
    height: clamp(320px, 46vh, 470px);
    overflow: visible;
    border: 0;
    background: transparent;
}

html[data-theme="light"] .monster-model-stage {
    background: transparent;
}

.monster-model-showcase .morph-canvas {
    pointer-events: none;
    touch-action: auto;
}

.monster-model-showcase.is-three-ready .morph-canvas {
    opacity: 1;
}

.monster-model-showcase.is-three-ready .morph-stage-fallback {
    display: none;
}

.monster-model-stage-fallback {
    border-color: var(--line);
}

.monster-model-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 18px;
    text-align: center;
}

.monster-model-fallback img {
    max-width: min(86%, 380px);
    max-height: 84%;
    object-fit: contain;
    filter: drop-shadow(0 24px 36px rgba(0,0,0,.36));
}

.monster-model-fallback strong {
    display: grid;
    place-items: center;
    width: 96px;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--gold);
    background: var(--control);
    font-size: 34px;
}

.monster-model-fallback span {
    color: var(--muted);
    font-weight: 800;
}

.monster-model-caption {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.monster-model-caption strong {
    color: var(--text);
}

.monster-model-caption span {
    color: var(--muted);
    text-align: right;
}

.monster-stats-panel h2:not(:first-child) {
    margin-top: 18px;
}

.morph-empty {
    display: grid;
    place-content: center;
    min-height: 420px;
    gap: 6px;
    text-align: center;
    color: var(--muted);
}

.morph-empty strong {
    color: var(--text);
    font-size: 20px;
}

.recipe-list {
    display: grid;
    gap: 12px;
}
.recipe-card {
    border: 1px solid #3f5d82;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(22, 47, 77, .92), rgba(13, 29, 49, .92));
    padding: 12px;
}
.recipe-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #2f4b6d;
}
.recipe-result em {
    color: var(--gold);
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}
.recipe-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.material-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    max-width: 340px;
    padding: 6px 9px;
    border: 1px solid #3f5d82;
    border-radius: 8px;
    background: #102943;
    color: #edf5ff;
}
.material-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.material-chip strong {
    color: var(--gold);
    white-space: nowrap;
}

body {
    background:
        linear-gradient(90deg, rgba(0,0,0,.76), rgba(0,0,0,.18) 48%, rgba(0,0,0,.72)),
        linear-gradient(135deg, rgba(164, 30, 40, .10), transparent 36%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

html[data-theme="light"] body {
    background:
        linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.22) 48%, rgba(255,255,255,.78)),
        linear-gradient(135deg, rgba(217, 174, 102, .16), transparent 38%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 42px);
    opacity: .35;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("game-ui/r2-title-bg.png") top right / min(780px, 62vw) auto no-repeat;
    opacity: .16;
    mix-blend-mode: screen;
}

html[data-theme="light"] body::before {
    background:
        repeating-linear-gradient(90deg, rgba(126, 93, 46, .028) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(0deg, rgba(126, 93, 46, .020) 0 1px, transparent 1px 42px);
    opacity: 1;
}

html[data-theme="light"] body::after {
    opacity: .06;
    mix-blend-mode: multiply;
}

.shell {
    position: relative;
    z-index: 1;
    grid-template-columns: 282px minmax(0, 1fr);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 42%),
        var(--sidebar);
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 42px var(--shadow);
}

html[data-theme="light"] .sidebar {
    box-shadow: 14px 0 35px rgba(143, 111, 70, .09);
}

.brand {
    min-height: 56px;
    margin-bottom: 26px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-color: var(--line-strong);
    color: var(--accent-2);
    background:
        linear-gradient(145deg, rgba(165, 30, 41, .82), rgba(39, 18, 19, .72)),
        var(--control);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 18px var(--shadow);
    clip-path: polygon(50% 0, 92% 18%, 82% 78%, 50% 100%, 18% 78%, 8% 18%);
}

html[data-theme="light"] .brand-mark {
    color: var(--red);
    background:
        linear-gradient(145deg, rgba(255,255,255,.95), rgba(244, 231, 212, .88)),
        var(--control);
}

.brand strong {
    display: block;
    letter-spacing: 0;
}

.brand small {
    color: var(--accent-2);
}

.side-search {
    position: relative;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

input, select, button {
    border-color: var(--line);
    background: var(--control);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}

input::placeholder {
    color: var(--input-placeholder);
}

button {
    background: linear-gradient(180deg, var(--accent-2), #8d6126);
    color: #fff8ec;
    border-color: rgba(240, 190, 97, .48);
    box-shadow: 0 9px 22px rgba(0,0,0,.24);
}

html[data-theme="light"] button {
    background: linear-gradient(180deg, #d7ad68, #bd8840);
    color: #fffaf1;
    box-shadow: 0 10px 20px rgba(151, 109, 57, .18);
}

nav {
    gap: 8px;
    margin-top: 10px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    border: 1px solid transparent;
    color: var(--muted);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

nav a::before {
    content: attr(data-icon);
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--accent-2);
    font-size: 16px;
}

nav a.active,
nav a:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background:
        linear-gradient(90deg, rgba(165, 30, 41, .72), rgba(88, 20, 26, .34)),
        var(--control-strong);
    box-shadow: inset 3px 0 0 var(--accent-2), 0 10px 24px rgba(99, 20, 27, .18);
}

html[data-theme="light"] nav a.active,
html[data-theme="light"] nav a:hover {
    background:
        linear-gradient(90deg, rgba(240, 224, 199, .92), rgba(255,255,255,.72)),
        var(--control-strong);
    box-shadow: inset 3px 0 0 var(--accent-2), 0 10px 24px rgba(151, 109, 57, .10);
}

.content {
    position: relative;
    padding: 28px;
}

.content::before {
    content: "R2";
    position: fixed;
    top: 30px;
    right: 42px;
    z-index: 0;
    color: var(--watermark);
    font-family: Georgia, serif;
    font-size: 72px;
    font-weight: 700;
    pointer-events: none;
}

.content > * {
    position: relative;
    z-index: 1;
}

.page-head {
    min-height: 82px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 76%, rgba(165,30,41,.20) 100%);
    box-shadow: 0 18px 48px var(--shadow);
}

html[data-theme="light"] .page-head {
    background:
        linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 76%, rgba(217,174,102,.18) 100%);
}

h1 {
    font-size: 26px;
    color: var(--text);
}

p,
.description,
.item-summary {
    color: color-mix(in srgb, var(--text) 84%, var(--muted));
}

.page-head p,
.muted {
    color: var(--muted);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    white-space: nowrap;
}

.theme-toggle-icon::before {
    content: "☾";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
}

html[data-theme="light"] .theme-toggle-icon::before {
    content: "☼";
}

.stat-card,
.panel,
.section-card {
    background:
        linear-gradient(180deg, var(--panel), var(--panel-2));
    border-color: var(--line);
    box-shadow: 0 18px 48px var(--shadow);
    backdrop-filter: blur(10px);
}

.items-browser {
    position: relative;
    overflow: hidden;
}

.items-browser.view-pages .table-wrap,
.items-browser.view-pages .item-table-scroll {
    max-height: none;
    min-height: 0;
}

.items-browser::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 8px;
    box-shadow: inset -1px 0 0 var(--line-strong);
}

.items-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 14px;
}

.view-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.view-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.view-switch a.active,
.view-switch a:hover {
    color: #fff4e4;
    background: linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82));
}

html[data-theme="light"] .view-switch a.active,
html[data-theme="light"] .view-switch a:hover {
    background: linear-gradient(180deg, #d7ad68, #bd8840);
    color: #fffaf1;
}

.items-count {
    color: var(--muted);
    margin: -2px 0 12px;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
    color: var(--text);
    font-weight: 700;
}

.pager span {
    color: var(--muted);
}

.pager a.active,
.pager a:hover {
    border-color: var(--line-strong);
    color: #fff4e4;
    background: linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82));
}

html[data-theme="light"] .pager a.active,
html[data-theme="light"] .pager a:hover {
    color: #fffaf1;
    background: linear-gradient(180deg, #d7ad68, #bd8840);
}

.effect-card {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(165, 30, 41, .18), transparent 72%),
        var(--control);
}

html[data-theme="light"] .effect-card {
    background:
        linear-gradient(135deg, rgba(217, 174, 102, .22), transparent 72%),
        var(--control);
}

.effect-card strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
}

.section-card:hover {
    border-color: var(--line-strong);
    background:
        linear-gradient(180deg, var(--control-strong), var(--panel-2));
}

.stat-card strong {
    color: var(--accent-2);
}

.tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.tabs a {
    flex: 0 0 auto;
    gap: 8px;
    min-height: 38px;
    border-color: var(--line);
    color: var(--text);
    background: var(--control);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.018);
}

.tabs a::before {
    content: attr(data-icon);
    color: var(--muted);
    min-width: 16px;
    text-align: center;
}

.tabs a.active {
    color: #fff4e4;
    border-color: var(--line-strong);
    background:
        linear-gradient(180deg, rgba(185, 38, 49, .84), rgba(106, 24, 31, .82)),
        var(--control-strong);
    box-shadow: 0 0 0 1px rgba(240, 82, 93, .18), 0 10px 26px rgba(165, 30, 41, .22);
}

.tabs a.active::before {
    color: var(--accent-2);
}

html[data-theme="light"] .tabs a.active {
    color: #fffaf1;
    background:
        linear-gradient(180deg, #d7ad68, #bd8840),
        var(--control-strong);
    box-shadow: 0 10px 24px rgba(151, 109, 57, .18);
}

.table-wrap {
    border-color: var(--line);
    background: rgba(255,255,255,.018);
}

html[data-theme="light"] .table-wrap {
    background: rgba(255,255,255,.58);
}

th {
    color: var(--text);
    background: var(--table-head);
}

th,
td {
    border-bottom-color: var(--line);
}

tr:nth-child(even) td {
    background: rgba(255,255,255,.018);
}

html[data-theme="light"] tr:nth-child(even) td {
    background: rgba(150, 105, 54, .020);
}

tr:hover td {
    background: var(--row-hover);
}

a,
.item-link {
    color: var(--text);
}

a:hover,
.item-link:hover {
    color: var(--accent-text);
}

html[data-theme="light"] a:hover,
html[data-theme="light"] .item-link:hover {
    color: var(--red);
}

.item-link span:first-letter {
    color: inherit;
}

.items-browser .item-link span,
.item-link[href*="page=item"] span {
    color: var(--accent-text);
}

.item-icon {
    border-color: var(--line-strong);
    background: var(--control);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 3px 10px var(--shadow);
}

.tag {
    background: var(--tag-bg);
    color: var(--accent-2);
    border-radius: 6px;
}

html[data-theme="light"] .tag {
    color: var(--gold);
}

.drop-chip,
.monster-drop-row,
.monster-drop-card,
.recipe-card,
.material-chip,
.code-line {
    border-color: var(--line);
    background: var(--control);
}

.recipe-card {
    background:
        linear-gradient(180deg, var(--panel), var(--panel-2));
}

.recipe-result {
    border-bottom-color: var(--line);
}

.recipe-result em,
.material-chip strong,
.drop-chip em {
    color: var(--accent-2);
}

.skill-browser {
    overflow: hidden;
}

.skill-calc {
    display: grid;
    gap: 14px;
}

.skill-calc-top {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.skill-calc-stat {
    min-width: 142px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.skill-calc-stat span,
.skill-calc-stat small {
    display: block;
    color: var(--muted);
}

.skill-calc-stat strong {
    display: block;
    color: var(--accent-2);
    font-size: 24px;
    line-height: 1.15;
    margin: 2px 0;
}

.skill-reset,
.skill-share {
    min-width: 130px;
}

.skill-calc-layout {
    display: grid;
    grid-template-columns: minmax(620px, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.skill-tree-shell {
    position: relative;
    overflow: auto;
    min-height: 560px;
    max-height: calc(100vh - 245px);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(4, 5, 6, .72), rgba(4, 5, 6, .84)),
        url("game-ui/skill-card-bg.png") center top / cover no-repeat,
        var(--panel-2);
    box-shadow: inset 0 0 0 1px rgba(217, 166, 74, .12), inset 0 0 42px rgba(0,0,0,.42);
}

html[data-theme="light"] .skill-tree-shell {
    background:
        linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.80)),
        url("game-ui/skill-card-bg.png") center top / cover no-repeat,
        var(--panel-2);
    box-shadow: inset 0 0 0 1px rgba(199, 144, 60, .16), inset 0 0 40px rgba(255,255,255,.48);
}

.skill-tree-board {
    --tree-cell-w: 214px;
    --tree-cell-h: 118px;
    --tree-gap-x: 18px;
    --tree-gap-y: 24px;
    display: grid;
    grid-template-columns: repeat(var(--tree-cols), var(--tree-cell-w));
    grid-template-rows: repeat(var(--tree-rows), var(--tree-cell-h));
    column-gap: var(--tree-gap-x);
    row-gap: var(--tree-gap-y);
    width: max-content;
    min-width: max-content;
    padding: 26px 28px 32px;
    border: 1px solid rgba(217, 166, 74, .28);
    border-radius: 8px;
    position: relative;
    background:
        linear-gradient(90deg, rgba(217, 166, 74, .18), transparent 1px) 0 0 / calc(var(--tree-cell-w) + var(--tree-gap-x)) 100%,
        linear-gradient(180deg, rgba(217, 166, 74, .13), transparent 1px) 0 0 / 100% calc(var(--tree-cell-h) + var(--tree-gap-y)),
        radial-gradient(circle at 50% 12%, rgba(217, 166, 74, .10), transparent 42%),
        linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.58));
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.03),
        inset 0 0 44px rgba(0,0,0,.56);
}

.skill-node {
    --skill-line-n: transparent;
    --skill-line-e: transparent;
    --skill-line-s: transparent;
    --skill-line-w: transparent;
    position: relative;
    min-width: 0;
}

.skill-node::before {
    content: "";
    position: absolute;
    inset: -18px;
    pointer-events: none;
    background:
        linear-gradient(var(--skill-line-n), var(--skill-line-n)) center top / 2px 50% no-repeat,
        linear-gradient(var(--skill-line-s), var(--skill-line-s)) center bottom / 2px 50% no-repeat,
        linear-gradient(var(--skill-line-e), var(--skill-line-e)) right center / 50% 2px no-repeat,
        linear-gradient(var(--skill-line-w), var(--skill-line-w)) left center / 50% 2px no-repeat;
}

.skill-node.line-n { --skill-line-n: var(--line-strong); }
.skill-node.line-e { --skill-line-e: var(--line-strong); }
.skill-node.line-s { --skill-line-s: var(--line-strong); }
.skill-node.line-w { --skill-line-w: var(--line-strong); }

.skill-node-empty {
    display: grid;
    place-items: center;
}

.skill-node-empty span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--control);
    opacity: .55;
}

.skill-node-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 12px 12px 34px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(255,255,255,.035), transparent 50%),
        var(--control);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 10px 26px var(--shadow);
}

.skill-node-main:hover {
    border-color: var(--line-strong);
}

.skill-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--accent-2);
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.18), transparent 34%),
        linear-gradient(145deg, rgba(96, 54, 24, .72), rgba(9, 20, 34, .88));
    font-weight: 900;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 4px 12px rgba(0,0,0,.28);
}

.skill-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    image-rendering: auto;
}

html[data-theme="light"] .skill-icon {
    color: var(--red);
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.55), transparent 36%),
        linear-gradient(145deg, rgba(251, 239, 218, .96), rgba(220, 177, 102, .34));
}

.skill-node-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.skill-node-copy strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    line-height: 1.2;
}

.skill-node-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.skill-level {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    align-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0,0,0,.22);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.skill-level b {
    color: var(--accent-2);
}

.skill-node-minus {
    position: absolute;
    z-index: 2;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    color: var(--muted);
    background: var(--control);
    opacity: .72;
}

.skill-node-minus:hover {
    color: #fff4e4;
    opacity: 1;
}

.skill-node.is-ready .skill-node-main {
    border-color: color-mix(in srgb, var(--accent-2) 68%, var(--line));
}

.skill-node.is-locked .skill-node-main {
    opacity: .56;
    filter: saturate(.76);
}

.skill-node.is-learned .skill-node-main {
    border-color: var(--line-strong);
    background:
        linear-gradient(135deg, rgba(185, 38, 49, .20), transparent 56%),
        var(--control-strong);
}

html[data-theme="light"] .skill-node.is-learned .skill-node-main {
    background:
        linear-gradient(135deg, rgba(217, 174, 102, .32), transparent 60%),
        var(--control-strong);
}

.skill-node.is-selected .skill-node-main {
    box-shadow: 0 0 0 1px var(--accent-2), 0 14px 30px var(--shadow);
}

.skill-node.is-maxed .skill-level b {
    color: var(--green);
}

.skill-details {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.skill-details-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-details-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
}

.skill-details h2 {
    margin-bottom: 0;
}

.skill-kv {
    grid-template-columns: 120px 1fr;
}

.skill-kv dd {
    min-width: 0;
}

.skill-desc {
    white-space: pre-line;
    line-height: 1.5;
}

.skill-condition-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-condition {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
    font-weight: 800;
}

.skill-condition.ok {
    color: var(--green);
}

.skill-condition.bad {
    color: var(--red);
}

.skill-picked-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.skill-picked {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.skill-picked strong {
    color: var(--text);
}

.skill-picked span {
    color: var(--muted);
    font-size: 12px;
}

.quest-browser-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.quest-search {
    margin-top: 12px;
}

.quest-chain-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 330px);
    min-height: 360px;
    overflow: auto;
    padding-right: 6px;
}

.quest-chain-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
}

.quest-chain-card.active,
.quest-chain-card:hover {
    border-color: var(--line-strong);
    background: var(--control-strong);
    color: var(--text);
}

.quest-chain-card strong {
    color: var(--text);
    line-height: 1.25;
}

.quest-chain-card span,
.quest-chain-card small {
    color: var(--muted);
}

.quest-detail {
    min-width: 0;
}

.quest-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--panel-2), color-mix(in srgb, var(--accent) 18%, transparent));
}

.quest-detail-head span {
    color: var(--gold);
    font-weight: 800;
}

.quest-detail-head h2 {
    margin: 3px 0 5px;
    font-size: 24px;
}

.quest-detail-head p {
    margin: 0;
    color: var(--muted);
}

.quest-detail-head strong {
    align-self: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--gold);
    white-space: nowrap;
}

.quest-step-list {
    display: grid;
    gap: 12px;
}

.quest-step-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.quest-step-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.quest-step-title div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.quest-step-title em {
    color: var(--gold);
    font-style: normal;
    font-weight: 800;
}

.quest-step-title strong {
    font-size: 18px;
    color: var(--text);
}

.quest-step-title span {
    color: var(--gold);
    font-weight: 900;
    white-space: nowrap;
}

.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.quest-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--control);
    color: var(--muted);
}

.quest-pill a {
    color: var(--text);
}

.quest-step-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .72fr);
    gap: 12px;
}

.quest-step-grid section {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
}

.quest-step-grid h3 {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 14px;
}

.quest-objectives,
.quest-rewards,
.quest-objective-group {
    display: grid;
    gap: 8px;
}

.quest-objective-group > strong {
    color: var(--text);
}

.quest-objective-row,
.quest-reward-row {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.quest-objective-row > span,
.quest-reward-row > span {
    color: var(--text);
}

.quest-objective-row em {
    justify-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-2) 16%, transparent);
    color: var(--gold);
    font-style: normal;
    font-weight: 900;
}

.quest-item-chip {
    display: inline-grid;
    grid-template-columns: 34px minmax(0, max-content) auto;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
}

.quest-item-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quest-item-chip strong {
    color: var(--gold);
}

.quest-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quest-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
    color: var(--muted);
}

.quest-source-chip a {
    color: var(--text);
}

.quest-source-chip small {
    color: var(--gold);
}

.quest-reward-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.quest-reward-row > strong {
    color: var(--gold);
}

.quest-reward-row .quest-item-chip {
    grid-column: 1 / -1;
}

.quest-empty {
    margin: 0;
    color: var(--muted);
}

.search-cards {
    display: grid;
    gap: 8px;
}

.search-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
}

.search-card:hover {
    border-color: var(--line-strong);
    background: var(--control-strong);
    color: var(--text);
}

.search-card span {
    color: var(--muted);
}

.visibility-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(165, 30, 41, .18), rgba(217, 166, 74, .10));
    color: var(--text);
}

.visibility-banner strong,
.visibility-toggle span {
    color: var(--gold);
}

.visibility-banner span {
    color: var(--muted);
}

.visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.visibility-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.visibility-cell {
    width: 1%;
    white-space: nowrap;
}

.visibility-title-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.visibility-title-cell .visibility-toggle {
    flex: 0 0 auto;
}

.visibility-title-cell > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visibility-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 16px;
}

.visibility-admin {
    display: grid;
    gap: 12px;
}

.visibility-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.visibility-admin-actions button {
    min-height: 34px;
}

.visibility-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.visibility-row-select,
.visibility-select-all input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.visibility-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--control);
    color: var(--muted);
    font-weight: 800;
}

.visibility-admin-row.is-marked-hidden .visibility-state {
    color: var(--gold);
}

.visibility-card {
    position: relative;
}

.is-marked-hidden,
tr.is-marked-hidden td {
    background-color: color-mix(in srgb, var(--accent) 18%, transparent);
    outline: 1px solid var(--line-strong);
}

.visibility-saving {
    opacity: .68;
}

.location-card.visibility-card {
    grid-template-columns: auto 94px minmax(0, 1fr);
    align-items: center;
}

.location-card-link,
.morph-book-link {
    display: contents;
    color: inherit;
}

.wiki-floor-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wiki-floor-mark .visibility-toggle {
    min-height: 28px;
    padding: 4px 7px;
}

.monster-card-actions,
.quest-detail-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.morph-book.visibility-card {
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
}

.morph-book.visibility-card .visibility-toggle {
    justify-self: end;
}

.quest-chain-card.visibility-card,
.search-card.visibility-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.quest-chain-link,
.search-card-link {
    display: grid;
    gap: 5px;
    color: inherit;
}

.quest-chain-card.visibility-card .visibility-toggle,
.search-card.visibility-card .visibility-toggle {
    align-self: start;
}

.kv dt {
    color: var(--muted);
}

.kv dd {
    color: var(--text);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent-2) 55%, transparent);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; padding: 16px; }
    .brand { margin-bottom: 14px; }
    .side-search {
        grid-template-columns: minmax(0, 1fr) 116px;
        margin-bottom: 12px;
    }
    nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .stats, .grid-2, .section-grid, .monster-drop-row, .monster-profile-grid, .morph-browser-grid, .morph-viewer-wrap, .quest-browser-grid, .quest-step-grid { grid-template-columns: 1fr; }
    .morph-book-list {
        min-height: 0;
        max-height: 360px;
    }
    .morph-stage {
        height: clamp(340px, 58vh, 460px);
        min-height: 0;
    }
    .skill-calc-layout { grid-template-columns: 1fr; }
    .skill-details { position: static; }
    .skill-tree-shell { min-height: 420px; max-height: 64vh; }
    .quest-chain-list {
        max-height: 360px;
        min-height: 0;
    }
    .quest-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .location-hero { grid-template-columns: 1fr; }
    .location-hero-image { max-height: 260px; }
    .filters { grid-template-columns: 1fr; }
    .filters.compact { grid-template-columns: 1fr; }
    .content { padding: 18px; }
    .content::before { display: none; }
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .theme-toggle { width: 100%; justify-content: center; }
    .tabs { flex-wrap: nowrap; }
    .items-browser.view-all .table-wrap,
    .items-browser.view-all .item-table-scroll {
        max-height: 62vh;
        min-height: 320px;
    }
    .items-toolbar { align-items: stretch; flex-direction: column; }
    .view-switch { width: 100%; }
    .view-switch a { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
    .side-search { grid-template-columns: 1fr; }
    .location-card { grid-template-columns: 78px minmax(0, 1fr); }
    .location-card.visibility-card { grid-template-columns: auto 78px minmax(0, 1fr); }
    .location-thumb { width: 78px; height: 78px; }
    .monster-drop-head { align-items: flex-start; }
    .monster-title { align-items: flex-start; }
    .monster-portrait { width: 44px; height: 44px; flex-basis: 44px; }
    .morph-book {
        grid-template-columns: 40px minmax(0, 1fr);
    }
    .morph-book.visibility-card {
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }
    .morph-book.visibility-card .visibility-toggle {
        grid-column: 2 / -1;
        justify-self: start;
    }
    .morph-book em {
        grid-column: 2;
        justify-self: start;
    }
    .morph-stage {
        height: 340px;
        min-height: 0;
    }
    .morph-side {
        padding: 12px;
    }
    .skill-calc-top { display: grid; }
    .skill-reset { width: 100%; }
    .skill-tree-board {
        --tree-cell-w: 146px;
        --tree-cell-h: 112px;
        --tree-gap-x: 14px;
        --tree-gap-y: 18px;
        padding: 18px;
    }
    .skill-node-main {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 10px 10px 34px;
    }
    .skill-icon {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }
    .skill-level {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.monster-mini-model .monster-mini-stage {
    width: 88px !important;
    height: 74px !important;
    min-height: 74px !important;
    overflow: hidden;
    border: 0;
    background: transparent !important;
}

    .monster-mini-model .morph-canvas {
    width: 88px !important;
    height: 74px !important;
}

.monster-mini-model.is-three-ready .morph-canvas,
.monster-model-showcase.is-three-ready .morph-canvas {
    opacity: 1 !important;
}

.monster-mini-model.is-three-ready .morph-stage-fallback,
.monster-model-showcase.is-three-ready .morph-stage-fallback {
    display: none !important;
}

/* R2 Rage presentation skin */
:root {
    --bg: #050404;
    --bg-top: #100c0b;
    --sidebar: rgba(7, 7, 8, .96);
    --panel: rgba(15, 13, 12, .88);
    --panel-2: rgba(9, 8, 8, .94);
    --control: rgba(14, 13, 13, .88);
    --control-strong: rgba(51, 12, 16, .90);
    --line: rgba(184, 129, 68, .20);
    --line-strong: rgba(210, 43, 46, .60);
    --text: #f3eadb;
    --muted: #b2a59a;
    --gold: #d6a04b;
    --red: #e43d3f;
    --accent: #9f171f;
    --accent-2: #d5a04a;
    --accent-text: #ff4e53;
    --table-head: rgba(18, 15, 14, .98);
    --row-hover: rgba(181, 35, 39, .15);
    --tag-bg: rgba(119, 25, 30, .72);
    --shadow: rgba(0, 0, 0, .58);
    --watermark: rgba(174, 32, 35, .10);
    --input-placeholder: #81746a;
}

html[data-theme="light"] {
    --bg: #f8f5ef;
    --bg-top: #fffdf8;
    --sidebar: rgba(255, 255, 255, .92);
    --panel: rgba(255, 255, 255, .90);
    --panel-2: rgba(250, 246, 238, .94);
    --control: rgba(255, 255, 255, .92);
    --control-strong: rgba(241, 229, 210, .94);
    --line: rgba(116, 78, 42, .20);
    --line-strong: rgba(194, 137, 67, .55);
    --text: #241b16;
    --muted: #74675d;
    --gold: #bd843b;
    --red: #b92631;
    --accent: #c59146;
    --accent-2: #d09a50;
    --accent-text: #b92631;
    --table-head: rgba(255, 255, 255, .96);
    --row-hover: rgba(205, 151, 76, .13);
    --tag-bg: rgba(237, 221, 196, .96);
    --shadow: rgba(105, 73, 37, .14);
    --watermark: rgba(189, 132, 59, .08);
    --input-placeholder: #9b8d80;
}

body {
    font: 15px/1.5 "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 76% 14%, rgba(116, 21, 22, .26), transparent 27%),
        radial-gradient(circle at 64% 6%, rgba(214, 160, 75, .10), transparent 18%),
        linear-gradient(90deg, rgba(0,0,0,.82), rgba(0,0,0,.28) 44%, rgba(0,0,0,.82)),
        linear-gradient(180deg, var(--bg-top), var(--bg));
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 76% 12%, rgba(205, 151, 76, .17), transparent 30%),
        linear-gradient(90deg, rgba(255,255,255,.84), rgba(255,255,255,.42) 48%, rgba(255,255,255,.86)),
        linear-gradient(180deg, var(--bg-top), var(--bg));
}

body::before {
    opacity: .28;
    background:
        repeating-linear-gradient(90deg, rgba(214,160,75,.035) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(0deg, rgba(214,160,75,.022) 0 1px, transparent 1px 56px);
}

body::after {
    background:
        linear-gradient(90deg, transparent, rgba(0,0,0,.42)),
        url("reference-skin/hero-knight.png") top right / min(620px, 44vw) auto no-repeat;
    opacity: .38;
    mix-blend-mode: screen;
}

html[data-theme="light"] body::after {
    opacity: .055;
    mix-blend-mode: multiply;
}

.shell {
    grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 32px 22px 22px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.035), transparent 34%),
        linear-gradient(180deg, rgba(121, 28, 31, .08), transparent 28%),
        var(--sidebar);
    border-right: 1px solid rgba(214, 160, 75, .16);
    box-shadow: 24px 0 54px rgba(0,0,0,.54);
}

.brand {
    gap: 16px;
    margin-bottom: 34px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    color: transparent;
    font-size: 0;
    background: url("reference-skin/crest.png") center / contain no-repeat;
    border: 0;
    clip-path: none;
    box-shadow: 0 14px 28px rgba(0,0,0,.46);
}

.brand strong {
    font-size: 20px;
    line-height: 1.05;
    color: #fff4df;
}

.brand small {
    color: var(--gold);
    font-family: Georgia, serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}

html[data-theme="light"] .brand strong {
    color: var(--text);
}

.side-search {
    gap: 10px;
    padding-bottom: 22px;
    margin-bottom: 22px;
}

.side-search label {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(0,0,0,.24);
    color: var(--gold);
}

.side-search label input {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

button,
.cache-refresh,
.theme-toggle,
.visibility-mode-toggle {
    border-radius: 5px;
}

.side-search button {
    min-height: 38px;
}

nav {
    gap: 13px;
}

nav a {
    min-height: 54px;
    padding: 0 14px;
    border-radius: 4px;
    color: #b8aca2;
    font-size: 16px;
}

nav a::before {
    width: 28px;
    height: 28px;
    color: var(--gold);
}

nav a.active,
nav a:hover {
    border-color: rgba(224, 48, 50, .55);
    background:
        linear-gradient(90deg, rgba(172, 24, 31, .86), rgba(74, 12, 15, .34)),
        rgba(17, 12, 12, .74);
    box-shadow: inset 3px 0 0 #ff3f42, 0 14px 28px rgba(118, 18, 22, .22);
}

.sidebar-update {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0 10px;
    align-items: center;
    margin-top: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255,255,255,.025);
    color: var(--gold);
}

.sidebar-update span {
    grid-row: span 2;
    width: 20px;
    height: 20px;
    color: transparent;
    background: var(--gold);
    -webkit-mask: url("reference-skin/icon-refresh.svg") center / contain no-repeat;
    mask: url("reference-skin/icon-refresh.svg") center / contain no-repeat;
    font-size: 0;
}

.sidebar-update small {
    color: var(--muted);
}

.sidebar-update strong {
    color: var(--text);
    font-weight: 600;
}

.content {
    padding: 54px 58px 38px;
}

.content::before {
    content: "";
    position: fixed;
    top: 26px;
    right: 44px;
    width: 128px;
    height: 128px;
    background: url("reference-skin/crest.png") center / contain no-repeat;
    opacity: .045;
}

.page-head,
.home-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(10, 9, 9, .92) 0%, rgba(12, 10, 10, .84) 58%, rgba(93, 16, 20, .42) 100%),
        var(--panel);
    box-shadow: 0 22px 70px rgba(0,0,0,.48);
}

.page-head::after,
.home-hero::after,
.stats::after,
.section-card::after,
.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), inset 0 0 38px rgba(158, 25, 30, .12);
}

.page-head {
    min-height: 112px;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
}

.page-head-copy {
    min-width: 0;
}

.page-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--gold);
    font-family: Georgia, serif;
    text-transform: uppercase;
    letter-spacing: .04em;
}

h1,
.home-hero h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    color: #f4ead8;
}

h1 {
    font-size: clamp(28px, 3vw, 42px);
}

.page-head p {
    max-width: 760px;
    color: #c8bdb2;
}

.page-actions,
.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.cache-refresh,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid var(--line);
    background: rgba(12, 10, 10, .72);
    color: #eadbc8;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 12px 26px rgba(0,0,0,.28);
}

.cache-refresh > span[aria-hidden="true"],
.theme-toggle > span[aria-hidden="true"] {
    display: none;
}

.cache-refresh::before,
.theme-toggle::before,
.visibility-mode-toggle::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    background: var(--gold);
    filter: drop-shadow(0 0 8px rgba(214,160,75,.20));
}

.cache-refresh::before {
    -webkit-mask: url("reference-skin/icon-refresh.svg") center / contain no-repeat;
    mask: url("reference-skin/icon-refresh.svg") center / contain no-repeat;
}

.theme-toggle::before {
    -webkit-mask: url("reference-skin/icon-moon.svg") center / contain no-repeat;
    mask: url("reference-skin/icon-moon.svg") center / contain no-repeat;
}

.visibility-mode-toggle::before {
    -webkit-mask: url("reference-skin/icon-items.svg") center / contain no-repeat;
    mask: url("reference-skin/icon-items.svg") center / contain no-repeat;
}

.cache-refresh:hover,
.theme-toggle:hover,
.visibility-mode-toggle:hover {
    border-color: var(--line-strong);
    color: #fff1dc;
}

.theme-toggle {
    border-color: rgba(216, 43, 47, .52);
    background:
        linear-gradient(90deg, rgba(101, 16, 20, .76), rgba(48, 10, 12, .86)),
        var(--control);
}

.visibility-mode-toggle.active {
    border-color: rgba(217, 166, 74, .72);
    background:
        linear-gradient(90deg, rgba(128, 80, 18, .76), rgba(48, 26, 8, .86)),
        var(--control);
    color: #fff1dc;
}

.theme-toggle-icon::before {
    color: var(--gold);
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    min-height: 250px;
    margin-bottom: 28px;
    padding: 44px 48px;
    background:
        linear-gradient(90deg, rgba(5,5,5,.96) 0%, rgba(5,5,5,.80) 48%, rgba(0,0,0,.22) 70%, rgba(74, 13, 16, .34) 100%),
        url("reference-skin/hero-knight.png") right 42px center / min(520px, 40vw) auto no-repeat,
        var(--panel);
}

.home-hero-copy {
    align-self: center;
}

.home-hero h1 {
    margin: 0;
    font-size: clamp(42px, 5vw, 66px);
    line-height: 1;
}

.home-hero h1 em {
    color: var(--red);
    font-style: normal;
    text-transform: uppercase;
}

.hero-rule {
    width: min(420px, 62vw);
    height: 1px;
    margin: 28px 0 24px;
    background: linear-gradient(90deg, var(--red), var(--red) 48%, transparent 48%, transparent 52%, var(--red) 52%, transparent);
}

.home-hero p {
    margin: 0;
    max-width: 610px;
    color: #cabeae;
    font-size: 17px;
}

.home-updated {
    grid-column: 2;
    align-self: end;
    justify-self: end;
    min-width: 190px;
    color: var(--muted);
    text-align: right;
}

.home-updated strong {
    display: block;
    margin-top: 4px;
    color: var(--gold);
    font-size: 18px;
}

.home-stats,
.stats {
    position: relative;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(15, 12, 11, .74), rgba(8, 7, 7, .88));
    gap: 0;
}

.home-stats {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    margin-bottom: 30px;
}

.stat-card {
    position: relative;
    display: grid;
    justify-items: center;
    min-height: 132px;
    padding: 22px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.stat-card:not(:last-child) {
    border-right: 1px solid rgba(214, 160, 75, .18);
}

.stat-card::before {
    content: attr(data-icon);
    color: rgba(214, 160, 75, .78);
    font-size: 28px;
}

.stat-card strong {
    margin: 3px 0 0;
    color: #f0b95e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 500;
}

.stat-card span {
    color: #b9aa9a;
    font-size: 16px;
}

.home-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 12px;
    width: min(1040px, 100%);
    margin: 0 auto 34px;
}

.home-search input {
    min-height: 70px;
    padding-left: 28px;
    border-color: var(--line-strong);
    background: rgba(8, 7, 7, .72);
    box-shadow: 0 0 38px rgba(154, 25, 28, .18);
    font-size: 17px;
}

.home-search button {
    min-height: 70px;
}

.section-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 20px;
}

.section-card {
    position: relative;
    min-height: 290px;
    padding: 26px 18px 22px;
    place-items: center;
    align-content: end;
    text-align: center;
    border-color: rgba(184, 129, 68, .30);
    border-radius: 5px;
    background:
        radial-gradient(circle at 50% 34%, rgba(176, 28, 31, .26), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 32%),
        rgba(10, 9, 9, .78);
}

.section-card::before {
    content: "";
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 150px;
    height: 142px;
    background: center / contain no-repeat;
    filter: drop-shadow(0 0 24px rgba(159, 25, 30, .34));
}

.section-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background:
        radial-gradient(circle at 50% 34%, rgba(198, 34, 38, .36), transparent 31%),
        linear-gradient(180deg, rgba(255,255,255,.05), transparent 32%),
        rgba(20, 13, 12, .88);
}

.section-card strong {
    max-width: 150px;
    color: #f5e2c4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    line-height: 1.05;
}

.section-card span {
    max-width: 170px;
    color: #b8aa9b;
    font-size: 15px;
}

.panel {
    position: relative;
    border-color: var(--line);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(20, 17, 16, .88), rgba(9, 8, 8, .92));
}

.tabs a,
.view-switch a,
.pager a,
.pager span {
    border-radius: 5px;
    background: rgba(9, 8, 8, .64);
    border-color: var(--line);
}

.tabs a.active,
.tabs a:hover,
.view-switch a.active,
.view-switch a:hover,
.pager a.active,
.pager a:hover {
    border-color: var(--line-strong);
    background:
        linear-gradient(180deg, rgba(169, 28, 34, .88), rgba(79, 13, 18, .90));
    color: #fff1dc;
}

.table-wrap {
    border-color: var(--line);
    border-radius: 6px;
    background: rgba(8, 7, 7, .62);
}

table {
    min-width: 860px;
}

th {
    color: #eadcc9;
    background: rgba(16, 13, 12, .98);
}

td {
    border-bottom-color: rgba(184, 129, 68, .16);
}

tr:hover td {
    background: var(--row-hover);
}

.tag {
    border-radius: 5px;
    color: #efc06b;
    background: var(--tag-bg);
}

html[data-theme="light"] .page-head,
html[data-theme="light"] .home-hero,
html[data-theme="light"] .home-stats,
html[data-theme="light"] .stats,
html[data-theme="light"] .panel,
html[data-theme="light"] .section-card {
    background:
        linear-gradient(180deg, var(--panel), var(--panel-2));
}

html[data-theme="light"] .brand-mark {
    color: transparent;
    background: url("reference-skin/crest.png") center / contain no-repeat;
    border: 0;
    clip-path: none;
}

html[data-theme="light"] .home-hero {
    background:
        linear-gradient(90deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.82) 48%, rgba(255,255,255,.48) 70%, rgba(244, 232, 215, .76) 100%),
        url("reference-skin/hero-knight.png") right 42px center / min(520px, 40vw) auto no-repeat,
        var(--panel);
}

html[data-theme="light"] h1,
html[data-theme="light"] .home-hero h1,
html[data-theme="light"] .section-card strong {
    color: var(--text);
}

html[data-theme="light"] .home-hero h1 em {
    color: var(--red);
}

html[data-theme="light"] .home-hero p,
html[data-theme="light"] .page-head p,
html[data-theme="light"] .section-card span,
html[data-theme="light"] .stat-card span {
    color: var(--muted);
}

html[data-theme="light"] .cache-refresh,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .home-search input,
html[data-theme="light"] .side-search label {
    background: rgba(255,255,255,.78);
    color: var(--text);
}

html[data-theme="light"] .theme-toggle {
    background: linear-gradient(180deg, #d7ad68, #bd8840);
    color: #fff8ec;
}

@media (max-width: 1320px) {
    .section-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 18px;
    }

    .sidebar-update {
        margin-top: 18px;
    }

    .content {
        padding: 20px;
    }

    .home-hero,
    .page-head {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .home-actions,
    .page-actions,
    .home-updated {
        grid-column: auto;
        justify-self: start;
        text-align: left;
    }

    .home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card:nth-child(2n) {
        border-right: 0;
    }

    .section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .content {
        padding: 14px;
    }

    .home-hero h1 {
        font-size: 38px;
    }

    .home-search {
        grid-template-columns: 1fr;
    }

    .home-stats,
    .section-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        border-right: 0 !important;
        border-bottom: 1px solid rgba(214, 160, 75, .16);
    }

    .stat-card:last-child {
        border-bottom: 0;
    }

    .section-card {
        min-height: 220px;
    }
}

/* Reference-sheet visual pass */
body {
    background:
        radial-gradient(circle at 78% 10%, rgba(125, 18, 21, .24), transparent 32%),
        linear-gradient(90deg, rgba(0,0,0,.90), rgba(0,0,0,.38) 48%, rgba(0,0,0,.90)),
        url("reference-skin/site-bg-premium.png") center top / cover no-repeat fixed,
        linear-gradient(180deg, var(--bg-top), var(--bg));
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 76% 12%, rgba(205, 151, 76, .14), transparent 30%),
        linear-gradient(90deg, rgba(255,255,255,.90), rgba(255,255,255,.56) 48%, rgba(255,255,255,.92)),
        url("reference-skin/site-bg-premium.png") center top / cover no-repeat fixed,
        linear-gradient(180deg, var(--bg-top), var(--bg));
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(0,0,0,.36), rgba(0,0,0,.78)),
        radial-gradient(circle at 50% 8%, rgba(122, 19, 22, .18), transparent 34%),
        url("reference-skin/site-bg-premium.png") left center / auto 100vh no-repeat fixed,
        var(--sidebar);
}

.sidebar .brand {
    position: relative;
    display: block;
    width: 100%;
    min-height: 182px;
    margin: 0 0 28px;
    background: url("reference-skin/logo-full.png") center / min(235px, 100%) auto no-repeat;
}

.sidebar .brand .brand-mark,
.sidebar .brand > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

body::after {
    background:
        radial-gradient(circle at 82% 14%, rgba(154, 28, 31, .22), transparent 26%),
        linear-gradient(90deg, transparent 0%, rgba(0,0,0,.20) 48%, rgba(0,0,0,.62) 100%);
    opacity: 1;
    mix-blend-mode: normal;
}

.content::before {
    background: url("reference-skin/logo-full.png") center / contain no-repeat;
    opacity: .035;
}

nav a::before {
    content: "•";
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    color: var(--gold);
    background: currentColor;
    font-size: 0;
    line-height: 1;
    -webkit-mask: var(--nav-mask) center / contain no-repeat;
    mask: var(--nav-mask) center / contain no-repeat;
    filter: drop-shadow(0 0 10px rgba(210, 151, 72, .24));
}

nav a:nth-child(1) { --nav-mask: url("reference-skin/icon-home.svg"); }
nav a:nth-child(2) { --nav-mask: url("reference-skin/icon-items.svg"); }
nav a:nth-child(3) { --nav-mask: url("reference-skin/icon-monsters.svg"); }
nav a:nth-child(4) { --nav-mask: url("reference-skin/icon-locations.svg"); }
nav a:nth-child(5) { --nav-mask: url("reference-skin/icon-quests.svg"); }
nav a:nth-child(6) { --nav-mask: url("reference-skin/icon-morphs.svg"); }
nav a:nth-child(7) { --nav-mask: url("reference-skin/icon-trees.svg"); }

.page-head {
    background:
        linear-gradient(90deg, rgba(5,5,5,.88), rgba(5,5,5,.70) 58%, rgba(93, 16, 20, .46)),
        url("reference-skin/topbar-panel.png") center / 100% 100% no-repeat,
        var(--panel);
}

.home-hero {
    grid-template-columns: 1fr;
    min-height: 276px;
    padding: 42px 48px 32px;
    background:
        linear-gradient(90deg, rgba(0,0,0,.98) 0%, rgba(0,0,0,.88) 40%, rgba(0,0,0,.40) 66%, rgba(69, 11, 15, .22) 100%),
        linear-gradient(180deg, rgba(255,255,255,.025), rgba(0,0,0,.12)),
        url("reference-skin/hero-generated-dark-knight.png") right center / cover no-repeat,
        var(--panel);
}

.home-hero::before {
    display: none;
}

.home-hero > * {
    position: relative;
    z-index: 1;
}

.home-hero-copy {
    max-width: calc(100% - 320px);
}

.home-hero h1 {
    white-space: nowrap;
    font-size: clamp(34px, 3.1vw, 58px);
}

.home-actions {
    position: absolute;
    top: 42px;
    right: 48px;
}

.home-updated {
    position: absolute;
    right: 48px;
    bottom: 38px;
    grid-column: auto;
}

.home-stats {
    min-height: 108px;
    margin-bottom: 24px;
    background:
        linear-gradient(180deg, rgba(8, 7, 7, .72), rgba(8, 7, 7, .86)),
        url("reference-skin/stats-panel.png") center / 100% 100% no-repeat;
}

.home-stats .stat-card {
    min-height: 108px;
    padding: 16px 12px 14px;
}

.home-stats .stat-card::before {
    content: "";
    width: 25px;
    height: 25px;
    background: #c89242;
    -webkit-mask: var(--stat-mask) center / contain no-repeat;
    mask: var(--stat-mask) center / contain no-repeat;
    filter: drop-shadow(0 0 14px rgba(214,160,75,.22));
}

.home-stats .stat-card:nth-child(1) { --stat-mask: url("reference-skin/icon-items.svg"); }
.home-stats .stat-card:nth-child(2) { --stat-mask: url("reference-skin/icon-monsters.svg"); }
.home-stats .stat-card:nth-child(3) { --stat-mask: url("reference-skin/icon-drops.svg"); }
.home-stats .stat-card:nth-child(4) { --stat-mask: url("reference-skin/icon-quests.svg"); }
.home-stats .stat-card:nth-child(5) { --stat-mask: url("reference-skin/icon-locations.svg"); }

.home-search {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 12px;
    margin-bottom: 26px;
}

.home-search input[name="q"] {
    min-height: 56px;
    background:
        linear-gradient(180deg, rgba(6, 5, 5, .76), rgba(6, 5, 5, .88)),
        url("reference-skin/search-panel.png") center / 100% 100% no-repeat;
}

.home-search button {
    min-height: 56px;
}

body[data-page="home"] .section-grid {
    grid-template-columns: repeat(6, 164px);
    align-items: start;
    justify-content: center;
    gap: clamp(16px, 1.8vw, 26px);
}

body[data-page="home"] .section-card {
    width: 164px;
    justify-self: center;
    min-height: 254px;
    aspect-ratio: auto;
    padding: 142px 14px 18px;
    border: 1px solid rgba(171, 42, 45, .52);
    border-radius: 4px;
    background:
        linear-gradient(90deg, rgba(239, 45, 50, .72), rgba(239, 45, 50, .72)) top left / 28px 1px no-repeat,
        linear-gradient(180deg, rgba(239, 45, 50, .72), rgba(239, 45, 50, .72)) top left / 1px 28px no-repeat,
        linear-gradient(270deg, rgba(239, 45, 50, .72), rgba(239, 45, 50, .72)) top right / 28px 1px no-repeat,
        linear-gradient(180deg, rgba(239, 45, 50, .72), rgba(239, 45, 50, .72)) top right / 1px 28px no-repeat,
        linear-gradient(90deg, rgba(239, 45, 50, .48), rgba(239, 45, 50, .48)) bottom left / 22px 1px no-repeat,
        linear-gradient(0deg, rgba(239, 45, 50, .48), rgba(239, 45, 50, .48)) bottom left / 1px 22px no-repeat,
        linear-gradient(270deg, rgba(239, 45, 50, .48), rgba(239, 45, 50, .48)) bottom right / 22px 1px no-repeat,
        linear-gradient(0deg, rgba(239, 45, 50, .48), rgba(239, 45, 50, .48)) bottom right / 1px 22px no-repeat,
        radial-gradient(circle at 50% 28%, rgba(187, 26, 31, .26), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,.045), rgba(13,10,10,.86) 58%, rgba(4,4,4,.96)),
        rgba(9,8,8,.88);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.045), inset 0 -36px 56px rgba(118, 18, 20, .10), 0 18px 42px rgba(0,0,0,.35);
}

body[data-page="home"] .section-card::after {
    display: block;
    border: 1px solid rgba(255,255,255,.035);
    box-shadow: inset 0 0 32px rgba(159, 25, 30, .14);
}

body[data-page="home"] .section-card::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 136px;
    height: 124px;
    transform: translateX(-50%);
    background: var(--card-art) center / contain no-repeat;
    opacity: .94;
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0 54%, rgba(0,0,0,.70) 70%, transparent 88%);
    mask-image: radial-gradient(ellipse at center, #000 0 54%, rgba(0,0,0,.70) 70%, transparent 88%);
    filter: saturate(1.18) contrast(1.08) brightness(1.08) drop-shadow(0 0 14px rgba(185, 22, 28, .52)) drop-shadow(0 10px 12px rgba(0,0,0,.68));
}

body[data-page="home"] .section-card strong,
body[data-page="home"] .section-card span {
    position: relative;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
}

body[data-page="home"] .section-card strong {
    max-width: 136px;
    color: #f4e1c4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    line-height: 1.08;
    text-shadow: 0 2px 8px rgba(0,0,0,.72);
}

body[data-page="home"] .section-card span {
    max-width: 136px;
    margin-top: 10px;
    color: #c4b6a7;
    font-size: 13px;
    line-height: 1.28;
}

body[data-page="home"] .section-card:nth-child(1) { --card-art: url("reference-skin/card-items.png"); }
body[data-page="home"] .section-card:nth-child(2) { --card-art: url("reference-skin/card-monsters.png"); }
body[data-page="home"] .section-card:nth-child(3) { --card-art: url("reference-skin/card-locations.png"); }
body[data-page="home"] .section-card:nth-child(4) { --card-art: url("reference-skin/card-quests.png"); }
body[data-page="home"] .section-card:nth-child(5) { --card-art: url("reference-skin/card-morphs.png"); }
body[data-page="home"] .section-card:nth-child(6) { --card-art: url("reference-skin/card-trees.png"); }

body[data-page="home"] .section-card:nth-child(n)::before {
    background: var(--card-art) center / contain no-repeat;
}

body[data-page="home"] .section-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 61, 65, .62);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 22px 58px rgba(148, 18, 22, .24), 0 18px 42px rgba(0,0,0,.42);
}

html[data-theme="light"] .sidebar .brand,
html[data-theme="light"] .content::before {
    background-image: url("reference-skin/logo-full.png");
}

html[data-theme="light"] .home-hero {
    background:
        linear-gradient(90deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.86) 44%, rgba(255,255,255,.48) 70%, rgba(244, 232, 215, .70) 100%),
        url("reference-skin/hero-generated-dark-knight.png") right center / cover no-repeat,
        var(--panel);
}

html[data-theme="light"] .page-head {
    background:
        linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.72) 58%, rgba(232, 211, 184, .52)),
        url("reference-skin/topbar-panel.png") center / 100% 100% no-repeat,
        var(--panel);
}

html[data-theme="light"] .home-stats {
    background:
        linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,.88)),
        url("reference-skin/stats-panel.png") center / 100% 100% no-repeat;
}

html[data-theme="light"] .home-search input[name="q"] {
    background:
        linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.94)),
        url("reference-skin/search-panel.png") center / 100% 100% no-repeat;
}

html[data-theme="light"] .home-stats,
html[data-theme="light"] body[data-page="home"] .section-card {
    background-blend-mode: normal;
}

@media (max-width: 1400px) and (min-width: 901px) {
    .home-hero h1 {
        max-width: none;
        white-space: normal;
        font-size: clamp(34px, 2.8vw, 46px);
    }

    .home-hero h1 em {
        display: block;
    }

    .hero-rule {
        margin: 18px 0 18px;
    }

    .home-hero p {
        max-width: 390px;
    }

    body[data-page="home"] .section-grid {
        grid-template-columns: repeat(3, 164px);
    }
}

@media (max-width: 900px) {
    .sidebar .brand {
        min-height: 118px;
        margin-bottom: 18px;
        background-size: auto 112px;
    }

    .home-hero {
        min-height: 0;
        background:
            linear-gradient(90deg, rgba(0,0,0,.96), rgba(0,0,0,.70)),
            url("reference-skin/hero-generated-dark-knight.png") right center / cover no-repeat;
    }

    .home-hero-copy {
        max-width: none;
    }

    .home-hero h1 {
        white-space: normal;
    }

    .home-actions,
    .home-updated {
        position: static;
    }

    .home-search {
        grid-template-columns: 1fr;
    }

    .home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-page="home"] .section-grid {
        grid-template-columns: repeat(2, minmax(150px, 164px));
        justify-content: center;
    }

    body[data-page="home"] .section-card {
        width: 100%;
    }
}

@media (max-width: 560px) {
    body[data-page="home"] .section-grid {
        grid-template-columns: minmax(150px, 164px);
    }
}
