/*
 * Tensura: Ragnarok 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: cold iron and frost for structure (the relic tooltips), bone and old gold for headings,
 * and each skill's own palette colour on its infobox and nothing else.
 * Corners stay square and things stay flat, the depth comes from Minecraft's slot bevel and the carved band under titles.
 */
:root {
  --accent: #8fb3cc; --on-accent: #101317;
  --night: #0b0e12; --panel: #14181d; --panel2: #1a1f25; --head: #22303b;
  --iron: #4c6475; --rule: #2c343c;
  --gold: #dcc58e; --bronze: #7d6648;
  --text: #e4e6e3; --muted: #9aa3a6; --link: #9cc7e8; --plus: #93d68f; --minus: #ee9090;
  --display: "Uncial Antiqua", Georgia, serif;
  --serif: "Alegreya", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  /* a plait like the bands on the runestones */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpath d='M0 2l8 6 8-6M0 8l8-6 8 6' fill='none' stroke='%237d6648' stroke-width='1.4'/%3E%3C/svg%3E");
  --runic: "Noto Sans Runic", serif;
  /* iron corner fittings with a rivet, like the bindings on a chest */
  --c-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 17V1h16' fill='none' stroke='%237d6648' stroke-width='2'/%3E%3Crect x='4' y='4' width='3' height='3' fill='%234c6475'/%3E%3C/svg%3E");
  --c-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 1h16v16' fill='none' stroke='%237d6648' stroke-width='2'/%3E%3Crect x='11' y='4' width='3' height='3' fill='%234c6475'/%3E%3C/svg%3E");
  --c-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 1v16h16' fill='none' stroke='%237d6648' stroke-width='2'/%3E%3Crect x='4' y='11' width='3' height='3' fill='%234c6475'/%3E%3C/svg%3E");
  --c-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M17 1v16H1' fill='none' stroke='%237d6648' stroke-width='2'/%3E%3Crect x='11' y='11' width='3' height='3' fill='%234c6475'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { background: var(--night); scrollbar-color: #36404a var(--night); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16.5px/1.55 var(--body); overflow-x: hidden; }
::selection { background: var(--iron); 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: .28; }
.bg .b { width: 620px; left: -240px; bottom: -200px; opacity: .22; }
.bg .c { width: 340px; left: 50%; bottom: -170px; opacity: .14; }
#snow { 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: #080a0d; border-bottom: 1px solid var(--iron); }
/* the plait runs along under the bar too */
.top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 7px; background: var(--band) repeat-x left center / 11px 7px, #080a0d; border-bottom: 1px solid var(--iron); }
.brand { display: flex; align-items: center; gap: 9px; font: 17px var(--display); color: var(--gold); }
.brand:hover { text-decoration: none; color: #fff; }
.brand img { width: 30px; height: 30px; }
.ver { margin-left: auto; color: var(--muted); font-size: 13.5px; }
.ver b { color: var(--text); font-weight: 500; }
.cf { height: 32px; display: flex; align-items: center; padding: 0 12px; color: #1a1206; background: #f16436; border: 1px solid #ff8a5c; font-weight: 600; font-size: 13.5px; text-decoration: none; }
.cf:hover { background: #ff7a4d; color: #1a1206; }
.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: 23px 16px 6px; gap: 14px; align-items: flex-start; }
.side { width: 190px; flex: none; position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow-y: auto; overflow-x: hidden; 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: 76%; margin: 12%; }
.navbox-side { margin-bottom: 10px; background: var(--panel); border: 1px solid var(--iron); }
.navbox-side h4 { margin: 0; padding: 3px 9px; color: var(--gold); font: 13.5px var(--display); letter-spacing: .03em; background: var(--head); border-bottom: 1px solid var(--bronze); }
.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(--iron); 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: #080a0d; border: 1px solid var(--iron); 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(--iron); 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; border: 1px solid var(--iron);
  background: var(--c-tl) left 3px top 3px no-repeat, var(--c-tr) right 3px top 3px no-repeat, var(--c-bl) left 3px bottom 3px no-repeat, var(--c-br) right 3px bottom 3px no-repeat, rgba(20, 24, 29, .97); }
.content::after { content: ""; display: block; clear: both; }

h1, h2, h3 { color: var(--gold); }
h1 { margin: 0 0 14px; padding-bottom: 16px; font: 31px/1.2 var(--display); background: var(--band) 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); }
/* othala, the rune for a homestead, marks each section */
.content > h2::before { content: "\16DF"; margin-right: .45em; font: 400 .72em var(--runic); color: var(--bronze); vertical-align: .12em; }
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: #cbcfc7; 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: #080a0d; 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 #36424c; 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: #252c33; }
table.wiki td.c, table.wiki th.c { text-align: center; }
table.wiki tr:nth-child(even) td { background: #171b21; }
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: #0d1014; box-shadow: inset 2px 2px 0 #040506, inset -2px -2px 0 #323a42; box-sizing: content-box; }
.tag { display: inline-block; margin: 2px 3px 2px 0; padding: 0 6px; font-size: 12.5px; line-height: 18px; color: #dbe8f2; background: #2b4252; white-space: nowrap; }
.tag.alt { color: #d6d3c8; background: #36363a; }
.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: #0d1014; border-bottom: 1px solid var(--rule); }
.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; margin: 9px 0; }
.circles figure { margin: 0; width: 200px; padding: 8px; text-align: center; font-size: 14px; color: var(--muted); background: #0d1014; 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(--iron); }
.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; }

.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: #cfd2cb; }

.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); color: var(--gold); }
.chain span { color: var(--bronze); }
table.craft { border-collapse: separate; border-spacing: 2px; margin: 6px 0; }

/* navbox at the end of an article */
.navbox { clear: both; margin-top: 28px; font-size: 14.5px; border: 1px solid var(--iron); 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: #252c33; 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; }
/* the elder futhark, all twenty-four in order */
footer::before { content: "\16A0\16A2\16A6\16A8\16B1\16B2\16B7\16B9  \16BA\16BE\16C1\16C3\16C7\16C8\16C9\16CA  \16CF\16D2\16D6\16D7\16DA\16DC\16DE\16DF"; display: block; margin-bottom: 7px; font: 15px var(--runic); letter-spacing: .55em; color: var(--bronze); white-space: pre; overflow: hidden; }

@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: 15px; }
  .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: 25px; }
  .nw { white-space: normal; }
  .cards, .skills { grid-template-columns: 1fr; }
  .navbox dl { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .mc i, .mc.open { animation: none !important; }
}
