/*
 * Tensura: Olympus wiki.
 * Laid out like the Tensura wiki and the Minecraft wiki: sidebar, tabs, one panel, infobox on the right, navbox at the end.
 * Colours are from the mod: lapis for structure (the base wiki's blue), bronze and ichor gold from the temples,
 * and each skill's own aura colour on its infobox and nothing else.
 * Corners stay square and things stay flat, the depth comes from Minecraft's slot bevel and the Greek key.
 */
:root {
  --accent: #2f5fa8; --on-accent: #fff;
  --night: #0d0e13; --panel: #18191f; --panel2: #1f2028; --head: #1f2f4e;
  --lapis: #3268b4; --rule: #30323c;
  --gold: #e8c277; --bronze: #a87f3d;
  --text: #e9e6dd; --muted: #a3a29a; --link: #8db4ff; --plus: #93d68f; --minus: #ee9090;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Alegreya", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 11h20V2H7v6h7V5' fill='none' stroke='%23a87f3d' stroke-width='1.4'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { background: var(--night); scrollbar-color: #3b3e4a var(--night); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16.5px/1.55 var(--body); overflow-x: hidden; }
::selection { background: var(--bronze); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img.pix { image-rendering: pixelated; }
.skip { position: absolute; left: -999px; top: 6px; z-index: 50; padding: 6px 12px; background: var(--gold); color: #000; }
.skip:focus { left: 8px; }

/* the mod's own circles, turning slowly behind everything */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg .mc { position: absolute; }
.bg .a { width: 900px; right: -300px; top: -120px; opacity: .3; }
.bg .b { width: 620px; left: -240px; bottom: -200px; opacity: .24; }
.bg .c { width: 340px; left: 50%; bottom: -170px; opacity: .16; }
#embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* a magic circle: three rings the same size. Inner and middle go one way, outer the other, a turn every 4s like the game */
.mc { position: relative; display: block; width: 100%; aspect-ratio: 1; }
.mc i { position: absolute; inset: 0; background-size: 100% calc(var(--n) * 100%); background-repeat: no-repeat; image-rendering: pixelated; will-change: transform; animation: strip calc(var(--n) * var(--ft)) steps(var(--n), jump-none) infinite, spin 4s linear infinite; }
.mc i.out { animation-name: strip, spinback; }
.mc.slow i { animation: spin 70s linear infinite; }
.mc.slow i.out { animation: spinback 70s linear infinite; }
@keyframes strip { to { background-position-y: 100%; } }
@keyframes spin { to { transform: rotate(-360deg); } }
@keyframes spinback { to { transform: rotate(360deg); } }
.mc.open { animation: open .7s ease-out both; }
@keyframes open { from { transform: rotate(-90deg) scale(.2); } to { transform: none; } }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 16px; background: #0a0b10; border-bottom: 1px solid var(--lapis); }
.brand { display: flex; align-items: center; gap: 9px; font: 700 16px var(--display); letter-spacing: .04em; color: var(--gold); }
.brand:hover { text-decoration: none; color: #fff; }
.brand img { width: 24px; height: 24px; image-rendering: pixelated; }
.ver { margin-left: auto; color: var(--muted); font-size: 13.5px; }
.ver b { color: var(--text); font-weight: 500; }
.icon { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: var(--text); background: var(--panel2); border: 1px solid var(--rule); cursor: pointer; }
.icon:hover { border-color: var(--gold); color: var(--gold); }
.icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: square; stroke-linejoin: miter; }
#sound .x { display: none; }
#sound.off { color: var(--muted); }
#sound.off .x { display: inline; }
#sound.off .w { display: none; }
.menu { display: none; }

.shell { display: flex; max-width: 1380px; margin: 0 auto; padding: 16px 16px 6px; gap: 14px; align-items: flex-start; }
.side { width: 190px; flex: none; position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow: auto; scrollbar-width: thin; }
.logo { position: relative; display: flow-root; width: 130px; margin: 20px auto 28px; }
.logo .mc { position: absolute; inset: -14%; width: 128%; }
.logo img { position: relative; display: block; width: 62%; margin: 19%; image-rendering: pixelated; }
.navbox-side { margin-bottom: 10px; background: var(--panel); border: 1px solid var(--lapis); }
.navbox-side h4 { margin: 0; padding: 3px 9px; color: var(--gold); font: 700 12.5px var(--display); letter-spacing: .08em; background: var(--head); }
.navbox-side a { display: flex; align-items: center; gap: 8px; padding: 3px 9px; color: var(--link); font-size: 15px; }
.navbox-side a img { width: 18px; height: 18px; flex: none; object-fit: contain; image-rendering: pixelated; }
.navbox-side a:hover { background: var(--panel2); text-decoration: none; color: #fff; }
.navbox-side a.here { color: #fff; font-weight: 700; background: var(--panel2); }

.column { flex: 1; min-width: 0; }
.tabs { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tab { position: relative; top: 1px; padding: 5px 14px; color: #fff; background: var(--panel); border: 1px solid var(--lapis); border-bottom-color: var(--panel); font-size: 14px; }
.search { position: relative; width: 270px; margin-bottom: 5px; }
.search input { width: 100%; padding: 5px 30px 5px 9px; background: #0a0b10; border: 1px solid var(--lapis); color: var(--text); font: 14.5px var(--body); }
.search input:focus { outline: 0; border-color: var(--gold); }
.search kbd { position: absolute; right: 7px; top: 5px; padding: 0 5px; color: var(--muted); font: 12px/18px var(--body); border: 1px solid var(--rule); }
#hits { position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--lapis); max-height: 360px; overflow: auto; display: none; }
#hits a, #hits .none { display: block; padding: 5px 9px; border-bottom: 1px solid var(--rule); color: var(--text); font-size: 14.5px; }
#hits a:hover, #hits a.on { background: var(--head); text-decoration: none; }
#hits small { display: block; color: var(--muted); font-size: 12.5px; }

.content { position: relative; padding: 18px 26px 30px; background: rgba(24, 25, 31, .97); border: 1px solid var(--lapis); }
.content::after { content: ""; display: block; clear: both; }

h1, h2, h3 { color: var(--gold); }
h1 { margin: 0 0 14px; padding-bottom: 16px; font: 700 32px/1.2 var(--display); letter-spacing: .01em; background: var(--key) repeat-x left bottom; }
h2 { margin: 26px 0 9px; padding-bottom: 3px; font: 600 23px/1.25 var(--serif); border-bottom: 1px solid var(--bronze); }
h3 { margin: 16px 0 3px; font: 700 17px var(--serif); }
.crumbs { margin-bottom: 3px; font-size: 14px; color: var(--muted); }
.hat { margin: -6px 0 12px; padding-left: 18px; color: var(--muted); font-style: italic; }
.quote { margin: 10px 0; padding: 2px 0 2px 14px; color: #cfcabb; font: italic 17px/1.45 var(--serif); border-left: 2px solid var(--bronze); }
.c { text-align: center; }
.muted { color: var(--muted); }
.nw { white-space: nowrap; }
.clear { clear: both; }
code { padding: 0 5px; font: 13.5px ui-monospace, Consolas, monospace; color: var(--gold); background: #0a0b10; border: 1px solid var(--rule); }

.toc { display: inline-block; margin: 6px 0 4px; padding: 7px 18px 9px 12px; background: var(--panel2); border: 1px solid var(--rule); font-size: 15px; }
.toc b { display: block; margin-bottom: 2px; font: 700 15px var(--serif); color: var(--text); }
.toc ol { margin: 0; padding-left: 20px; }

.wrap { overflow-x: auto; margin: 9px 0; }
table.wiki { border-collapse: collapse; width: 100%; background: var(--panel2); font-size: 15.3px; line-height: 1.42; }
table.wiki.small { width: auto; min-width: 280px; margin: 9px 0; }
table.wiki th, table.wiki td { border: 1px solid #3c4252; padding: 6px 10px; vertical-align: top; text-align: left; }
table.wiki th { color: #fff; font: 700 14.5px var(--body); background: var(--head); }
table.wiki th.l { white-space: nowrap; background: #272a35; }
table.wiki td.c, table.wiki th.c { text-align: center; }
table.wiki tr:nth-child(even) td { background: #1b1c24; }
td.ic { width: 52px; text-align: center !important; vertical-align: middle !important; }
/* the inventory slot */
.ic img, .cardh img, .skillcard img, .tile img, .slot { padding: 3px; background: #101116; box-shadow: inset 2px 2px 0 #050508, inset -2px -2px 0 #33353f; box-sizing: content-box; }
.tag { display: inline-block; margin: 2px 3px 2px 0; padding: 0 6px; font-size: 12.5px; line-height: 18px; color: #d9e4ff; background: #223a66; white-space: nowrap; }
.tag.alt { color: #d6d3c8; background: #36343a; }
.tag.gold { color: #17130b; background: var(--gold); }

.infobox { float: right; width: 300px; margin: 0 0 14px 22px; background: var(--panel2); border: 1px solid var(--accent); font-size: 15px; }
.ibt { padding: 5px 9px; text-align: center; font: 700 16px var(--serif); color: var(--on-accent); background: var(--accent); }
.ibi { padding: 10px; background: #101116; border-bottom: 1px solid var(--rule); }
.ibi picture, .ibi picture img { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; aspect-ratio: 1; }
.seal { position: relative; display: block; width: 220px; margin: 0 auto; }
.seal img { position: absolute; left: 32%; top: 32%; width: 36%; height: 36%; image-rendering: pixelated; }
.pixbox .ibi > img { display: block; width: 128px; height: 128px; margin: 0 auto; image-rendering: pixelated; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { padding: 4px 9px; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; }
.infobox tr:first-child th, .infobox tr:first-child td { border-top: 0; }
.infobox th { font-weight: 500; color: var(--muted); width: 48%; }

.circles { display: flex; flex-wrap: wrap; gap: 12px; }
.circles figure { margin: 0; width: 200px; padding: 8px; text-align: center; font-size: 14px; color: var(--muted); background: #101116; border: 1px solid var(--rule); }
.circles figcaption { margin-top: 6px; }

/* main page */
.mainpage { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; align-items: start; }
.box { margin-bottom: 14px; background: var(--panel2); border: 1px solid var(--lapis); }
.box > h2 { margin: 0; padding: 4px 11px; color: var(--gold); font: 600 18px var(--serif); border: 0; background: var(--head); }
.box > div { padding: 10px 12px; }
.box p:first-child { margin-top: 0; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; color: var(--text); text-align: center; line-height: 1.2; font-size: 15px; }
.tile:hover { color: #fff; background: var(--panel); text-decoration: none; }
.tile img { object-fit: contain; }
.tile small { color: var(--muted); font-size: 12.5px; }
.feature { display: flow-root; }
.feature .art { float: left; width: 118px; margin: 0 12px 4px 0; }
.feature .art picture, .feature .art picture img { display: block; width: 100%; height: auto; aspect-ratio: 1; }

.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; margin: 9px 0; }
.skillcard { display: grid; grid-template-columns: 56px 1fr; column-gap: 11px; padding: 8px; color: var(--text); background: var(--panel2); border: 1px solid var(--rule); line-height: 1.3; }
.skillcard:hover { border-color: var(--c); text-decoration: none; }
.skillcard img { grid-row: span 3; width: 50px; height: 50px; image-rendering: pixelated; }
.skillcard b { font: 700 17px var(--serif); color: var(--c); }
.skillcard small { color: var(--muted); font-size: 13.5px; }
.skillcard span { font-size: 14.5px; color: #cfccc2; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 9px; }
.card { padding: 10px 12px; background: var(--panel2); border: 1px solid var(--rule); font-size: 15px; line-height: 1.42; }
.cardh { display: flex; gap: 11px; align-items: center; }
.card h3 { margin: 0; font-size: 17.5px; }
.card p { margin: 7px 0; }
.gift, .syn { margin: 6px 0; padding-left: 18px; }
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.syn { color: var(--muted); font-size: 14px; border-top: 1px solid var(--rule); padding-top: 6px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; font: 700 18px var(--serif); }
.chain span { color: var(--bronze); }

.mobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
.mob { display: flex; flex-direction: column; align-items: center; padding: 8px; background: #101116; border: 1px solid var(--rule); text-align: center; color: var(--text); line-height: 1.25; }
.mob:hover { border-color: var(--gold); text-decoration: none; }
.mob picture, .mob img { display: block; width: 100%; max-width: 150px; height: auto; aspect-ratio: 1; object-fit: contain; }
.mob b { font: 700 16px var(--serif); margin-top: 3px; }
.mob span { font-size: 13.5px; color: var(--muted); }
.moveset { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 8px; }
.moveset figure { margin: 0; padding: 6px; text-align: center; font-size: 14.5px; color: var(--muted); background: #101116; border: 1px solid var(--rule); }
.moveset img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
table.craft { border-collapse: separate; border-spacing: 2px; margin: 6px 0; }
table.craft td { width: 40px; height: 40px; padding: 3px; text-align: center; vertical-align: middle; background: #101116; box-shadow: inset 2px 2px 0 #050508, inset -2px -2px 0 #33353f; }
table.craft img { display: block; margin: auto; }

/* navbox at the end of an article */
.navbox { clear: both; margin-top: 28px; font-size: 14.5px; border: 1px solid var(--lapis); background: var(--panel2); }
.navbox > b { display: block; padding: 3px 9px; text-align: center; font: 700 16px var(--serif); color: var(--gold); background: var(--head); }
.navbox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.navbox dt { padding: 3px 10px; font-weight: 700; color: #fff; background: #272a35; border-top: 1px solid var(--rule); }
.navbox dd { margin: 0; padding: 3px 10px; border-top: 1px solid var(--rule); }
.navbox dd a:not(:last-child)::after { content: "\00a0\00b7"; color: var(--muted); display: inline-block; }

#up { position: fixed; right: 16px; bottom: 16px; z-index: 15; display: none; }
#up.show { display: grid; }
footer { padding: 11px 2px 18px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 1100px) {
  .infobox { float: none; width: auto; max-width: 420px; margin: 0 auto 16px; }
  .mainpage { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu { display: grid; }
  .ver { display: none; }
  #sound { margin-left: auto; }
  .brand { font-size: 14px; }
  .bg .a { width: 520px; right: -240px; }
  .bg .b, .bg .c { display: none; }
  .shell { display: block; padding: 10px 10px; }
  .side { display: none; position: static; width: auto; max-height: none; margin-bottom: 10px; }
  body.open .side { display: block; }
  .logo { display: none; }
  .tabs { flex-wrap: wrap; }
  .search { width: 100%; order: -1; }
  .search kbd { display: none; }
  .content { padding: 14px 13px 22px; }
  h1 { font-size: 26px; }
  .nw { white-space: normal; }
  .cards, .skills { grid-template-columns: 1fr; }
  .mobs, .moveset { grid-template-columns: repeat(2, 1fr); }
  .navbox dl { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .mc i, .mc.open { animation: none !important; }
}
