.game-guide-toc { display:flex; flex-wrap:wrap; gap:5px 7px; margin:8px 0 11px; }
.game-guide-toc a { display:inline-flex; align-items:center; min-height:26px; padding:2px 8px; background:#e5eadc; border:1px solid #aab69e; border-radius:2px; }
.game-guide-chapter { padding-top:4px; scroll-margin-top:12px; }
.game-guide-chapter h2 { margin:14px 0 7px; }
.game-guide-chapter h3 { margin:10px 0 4px; }
.game-guide-chapter p, .game-guide-chapter ul { margin:5px 0 9px; }
.game-guide-steps { display:grid; gap:6px; grid-template-columns:repeat(3,minmax(0,1fr)); margin:9px 0; padding:0; list-style:none; counter-reset:guide-step; }
.game-guide-steps li { position:relative; margin:0; padding:7px 9px 8px 33px; background:#ebe7d8; border:1px solid #c8bda5; counter-increment:guide-step; }
.game-guide-steps li::before { content:counter(guide-step); position:absolute; left:8px; top:8px; color:#fff1ca; background:#344a36; width:17px; text-align:center; border-radius:2px; }
.game-guide-steps li strong { display:block; color:#263f2d; }
.game-guide-steps li span { display:block; margin-top:3px; }
.guide-chapter-jumps { font-size:12px; }
.guide-chapter-jumps a { text-decoration:underline; text-underline-offset:2px; }
.guide-chapter-table td:first-child { font-weight:bold; }
.guide-chapter-table td, .guide-chapter-table th { line-height:1.4; }
.guide-chapter-table caption { text-align:left; color:#263f2d; margin:3px 0 6px; font-weight:bold; }
.guide-chapters .wiki-guide-figure img { width:min(100%,480px); }
.guide-snapshot { color:#514d40; font-size:12px; }

.mastery-controls, .mastery-share { display:flex; flex-wrap:wrap; align-items:end; gap:7px 12px; }
.mastery-controls label, .mastery-slot-list label, .mastery-share label { display:grid; gap:3px; font-weight:600; }
.mastery-controls input, .mastery-controls select, .mastery-share input, .mastery-slot-list select { min-width:0; padding:5px; border:1px solid #a0967d; background:#fffbee; color:#292c24; }
.mastery-controls input { width:108px; }
.mastery-controls button, .mastery-share button, .mastery-node-controls button, .mastery-charm button, .mastery-text-button { padding:4px 8px; border:1px solid #65795f; border-radius:2px; color:#fff4d0; background:#3a533e; min-height:26px; cursor:pointer; }
.mastery-controls button[disabled], .mastery-node-controls button[disabled], .mastery-text-button[disabled], .mastery-charm button[disabled] { background:#dedbcc; border-color:#c5bea8; color:#5a564b; cursor:default; }
.mastery-budget { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:0; margin:9px 0 4px; }
.mastery-budget div { background:#e5eadc; border:1px solid #aab69e; padding:4px 7px; }
.mastery-budget dt { font-size:11px; color:#475a49; }
.mastery-budget dd { margin:0; font:600 18px Georgia,serif; color:#263f2d; }
.mastery-progress { width:100%; height:8px; accent-color:#637a5e; }
.mastery-status { margin:1px 0 7px; min-height:18px; font-size:12px; color:#405340; }
.mastery-status:empty { min-height:0; }
.mastery-routes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; align-items:start; }
.mastery-domain { padding:6px; background:#e7e7d9; border:1px solid #b6bba8; min-width:0; border-radius:2px; }
.wiki-content .mastery-domain h2 { margin:0 0 1px; padding:0; border:0; font-size:17px; }
.mastery-domain-theme { margin:2px 0 7px; color:#514d40; font-size:11px; }
.mastery-tree { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 4px; }
.mastery-node { position:relative; grid-column:1/-1; background:#f7f2e4; border:1px solid #b8ae93; padding:4px 5px; min-width:0; }
.mastery-node[data-position='3'], .mastery-node[data-position='4'] { grid-column:auto; }
.mastery-node:not([data-position='0'])::before { content:''; position:absolute; top:-11px; left:50%; width:1px; height:10px; background:#83947c; }
.mastery-node[data-position='5']::after { content:''; position:absolute; width:50%; height:1px; left:25%; top:-11px; background:#83947c; }
.mastery-node[data-state='allocated'] { background:#dce6d6; border-color:#7d9579; }
.mastery-node[data-state='available'] { border-color:#a18b52; }
.mastery-node strong, .mastery-node small, .mastery-node-effect { display:block; }
.mastery-node strong { color:#263f2d; line-height:1.3; }
.mastery-node-cost, .mastery-node-lock { font-size:10px; color:#574f41; }
.mastery-node-effect { color:#37483b; font-size:11px; line-height:1.35; margin-top:2px; }
.mastery-node-controls { display:flex; justify-content:center; align-items:center; gap:4px; margin:4px 0 1px; }
.mastery-node-controls button { padding:0; width:24px; flex:none; font-weight:700; }
.mastery-node-controls span { font-variant-numeric:tabular-nums; }
.mastery-signature { margin:6px 0; padding:4px 6px; border:1px solid #b6bba8; background:#f0ede0; }
.mastery-signature summary { cursor:pointer; color:#263f2d; font-size:12px; font-weight:600; }
.mastery-signature p { font-size:11px; margin:4px 0; }
.mastery-text-button { width:100%; font-size:11px; }
.mastery-stats { list-style:none; padding:0; margin:6px 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 9px; }
.mastery-stat { background:#ece8db; border:1px solid #cec4ab; margin:0; padding:4px 6px; }
.mastery-stat-caption { display:flex; justify-content:space-between; gap:4px; font-size:11px; }
.mastery-stat-caption span { color:#514d40; white-space:nowrap; }
.mastery-stat meter { width:100%; height:8px; }
.mastery-share { margin:9px 0; }
.mastery-share label { flex:1 1 220px; }
.mastery-share-status { min-width:100%; font-size:12px; }
.mastery-slot-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.mastery-slot-list label { padding:5px; background:#e5eadc; border:1px solid #aab69e; }
.mastery-slot-list label small { font-weight:normal; }
.mastery-charm-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:7px 0; }
.mastery-charm { display:grid; gap:3px; padding:6px; background:#ebe7d8; border:1px solid #c8bda5; }
.wiki-content .mastery-charm h3, .mastery-charm p { margin:0; }
.mastery-charm p { font-size:12px; }
.mastery-charm small { color:#514d40; }
.mastery-charm button { justify-self:start; align-self:end; margin-top:3px; }

@media(max-width:620px) {
    .mastery-routes { grid-template-columns:minmax(0,1fr); }
    .mastery-node-controls button { min-width:32px; min-height:30px; }
    .game-guide-steps { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:420px) {
    .mastery-stats,.mastery-charm-grid { grid-template-columns:minmax(0,1fr); }
    .mastery-budget { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
