html {
    scroll-behavior: smooth;
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: #3a3131 #120f0f;
}

@supports not (scrollbar-color: auto) {
    ::-webkit-scrollbar              { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track        { background: #120f0f; }
    ::-webkit-scrollbar-thumb        { background: #3a3131; border-radius: 10px; border: 2px solid #120f0f; }
    ::-webkit-scrollbar-thumb:hover  { background: #5a4d4d; }
}

.wiki {
    --text:      #9d9797;
    --strong:    #f4f1f1;
    --accent:    #9a8cff;
    --hover:     #ff9f43;
    --card:      #181414;
    --border:    #2a2323;
    --header-h:  60px;
}

/* ===== LAYOUT ===== */
.wiki {
    display: grid;
    grid-template-columns: minmax(0, 1060px) 230px;
    justify-content: space-between;
    gap: 48px;
    max-width: none;
    margin: 0;
    padding: 24px 22px 90px 56px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
}
.wiki-content { min-width: 0; }

/* ===== TITLES ===== */
.wiki h1 {
    margin: 0 0 8px;
    text-align: left;
    font-size: 2rem;
    color: var(--strong);
}
.wiki h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 52px 0 12px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    font-size: 1.45rem;
    color: var(--strong);
    scroll-margin-top: calc(var(--header-h) + 8px);
}
.wiki h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 8px;
    font-size: 1.1rem;
    color: var(--strong);
    scroll-margin-top: calc(var(--header-h) + 20px);
}
.wiki h2 :is(i, svg), .wiki h3 :is(i, svg) {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    color: var(--accent);
}

/* ===== TEXT ===== */
.wiki p { margin: 0 0 14px; max-width: 75ch; font-size: 1rem; }
.wiki b, .wiki strong { color: var(--strong); font-weight: 700; }
.wiki a { color: var(--accent); }
.wiki code {
    padding: 2px 6px;
    border-radius: 4px;
    background: #2b2d31;
    color: #dbdee1;
    font-family: monospace;
    font-size: 0.9em;
}

/* ===== LISTS ===== */
.wiki ul { margin: 0 0 16px; padding-left: 24px; }
.wiki li { margin-bottom: 6px; padding-left: 6px; }
.wiki li::marker { color: #52525b; }

/* ===== COMMANDS ===== */
.wiki .cmd-list { list-style: none; padding: 0; }
.wiki .cmd-list li { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cmd-list .command {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 9px;
    border-radius: 7px;
    background: rgba(192, 132, 252, .12);
    border: 1px solid rgba(192, 132, 252, .30);
    color: #c084fc;
    font-family: monospace;
}
.cmd-list .base { color: #7a90ff; }

/* ===== IMAGES ===== */
.wiki {
    --tile-w: 460px;
    --tile-h: 290px;
    --radius: 14px;
}
.shots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 22px 0 8px;
}
.shots a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--tile-w);
    max-width: 100%;
    height: var(--tile-h);
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, box-shadow .2s;
}
.shots img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: calc(var(--radius) - 6px);
}
.shots a:hover {
    border-color: var(--hover);
    box-shadow: 0 8px 26px rgba(255, 159, 67, 0.22);
}
.shots a.strip {
    flex: 1 1 100%;
    width: auto;
    height: auto;
    max-width: 880px;
}
.shots a.strip img { max-height: none; }

/* ===== INFO BOXES ===== */
.callout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 75ch;
    margin: 18px 0;
    padding: 14px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: #d4d4d8;
}
.callout :is(i, svg) {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 3px;
    color: #d4d4d8;
}
.callout p { margin: 0; }
.callout.warning { border-color: #854d0e; }
.callout.warning :is(i, svg) { color: #facc15; }
.callout.danger  { border-color: #7f1d1d; }
.callout.danger  :is(i, svg) { color: #f87171; }
.callout.tip     { border-color: #3b3470; }
.callout.tip     :is(i, svg) { color: var(--accent); }

/* ===== ENCHANTMENT TABLES ===== */
.table_container {
    margin: 14px 0 8px;
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.neon_table { width: 100%; border-collapse: collapse; font-size: 0.85rem; line-height: 1.5; }
.neon_table th {
    padding: 10px 12px;
    text-align: center;
    white-space: nowrap;
    color: var(--strong);
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}
.neon_table td {
    padding: 9px 12px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.neon_table th:nth-child(-n+2),
.neon_table td:nth-child(-n+2) { text-align: left; }
.neon_table td:nth-child(1) { color: var(--strong); white-space: nowrap; }
.neon_table td:nth-child(2) { min-width: 220px; }
.neon_table img {
    width: 28px;
    height: 28px;
    margin: 0 1px;
    vertical-align: middle;
    image-rendering: pixelated;
}
.neon_table tbody tr:hover { background: rgba(255, 255, 255, 0.05); }

/* ===== TABLE OF CONTENTS ===== */
.toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding-right: 6px;
    font-size: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: #3a3131 transparent;
}
.toc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--strong);
}
.toc-title :is(i, svg) { width: 18px; height: 18px; }

.toc ul { list-style: none; margin: 0; padding: 0; border: 0; }
.toc > ul { border-left: 1px solid var(--border); }
.toc li { margin: 0; padding: 0; }

.toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 6px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text);
    text-decoration: none;
    transition: color .2s, border-color .2s;
}
.toc a :is(i, svg) { width: 17px; height: 17px; flex-shrink: 0; }
.toc a:hover { color: var(--hover); }
.toc .subs a { padding-left: 36px; font-size: 0.86rem; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .group.open > a { color: var(--accent); }
.toc.js .group:not(.open) > .subs { display: none; }

/* ===== MOBILE ===== */
@media (max-width: 900px) {
    .wiki { grid-template-columns: 1fr; padding: 16px; }
    .toc  { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
