/* Midgard Wiki: light, readable on a phone, the colours of the Midgard logo (navy + gold); font Kanit (../fonts) */
:root {
	--bg: #f3f5fb; --panel: #ffffff; --ink: #1d2540; --muted: #6a7392; --line: #dfe4f0; --navy: #1f3270; --navy2: #33509e; --gold: #e2a72e;
	--hover: #eef3ff; --font: 'Kanit', 'Leelawadee UI', Tahoma, sans-serif; --head: 'Kanit', 'Leelawadee UI', Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root { --bg: #0f1424; --panel: #182038; --ink: #e8ecf8; --muted: #9aa5c6; --line: #2a3557; --navy: #9cb6ff; --navy2: #7f9ef0; --hover: #1f2a4a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--navy2); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
pre { background: #10172e; color: #e6edff; padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
code { background: var(--hover); padding: 1px 5px; border-radius: 5px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 18px;
	background: linear-gradient(120deg, #142456, #2c4a9a); box-shadow: 0 2px 12px rgba(10, 20, 60, 0.35); }
.brand { display: flex; align-items: center; gap: 6px; color: #fff; font: 700 18px var(--head); }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; border-radius: 6px; }
.brand span { padding: 1px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.15); }
.search { flex: 1; min-width: 220px; max-width: 460px; }
.search input { width: 100%; height: 38px; padding: 0 14px; border: 0; border-radius: 19px; font: 15px var(--font); background: #fff; color: #1d2540; }
#nav { display: flex; flex-wrap: wrap; gap: 4px; }
#nav a { padding: 6px 12px; border-radius: 16px; color: #dfe7ff; font: 600 14px var(--head); }
#nav a:hover, #nav a.on { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
#nav a.play { background: linear-gradient(#ffcf5a, #f0a315); color: #3b2500; }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; color: var(--navy); margin: 0.6em 0 0.4em; }
h2 small, h3 small { font: 13px var(--font); color: var(--muted); }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* home */
.hero { text-align: center; padding: 20px 10px 6px; }
.hero h1 { font-size: 32px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.card { display: block; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 2px 8px rgba(20, 40, 100, 0.06); transition: transform 0.12s; }
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--navy2); }
.card b { font-size: 30px; }
.card h3 { margin: 4px 0; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }

/* filters + lists */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.filters input, .filters select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--font); background: var(--bg); color: var(--ink); }
.filters input[type=number] { width: 64px; }
.filters .chk { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.filters .chk input { height: auto; }
.filters button { height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--navy2); color: #fff; font: 600 14px var(--head); cursor: pointer; }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.row:hover { text-decoration: none; background: var(--hover); border-color: var(--navy2); }
.row .nm { min-width: 0; }
.row .nm b { font-weight: 600; }
.row .nm small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .lv { font: 700 14px var(--head); color: var(--navy); }
.row .num { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mvp { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 6px; background: #e0423a; color: #fff; }
.agg { font-style: normal; color: #d33; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; color: #fff; background: var(--c); white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 16px 0; }
.pager a, .pager span { min-width: 34px; padding: 4px 8px; text-align: center; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.pager a.on { background: var(--navy2); color: #fff; }

/* pictures */
.pic { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.pic:not(.ok) { visibility: hidden; }
.pic.mob:not(.ok) { visibility: visible; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--panel), var(--hover)); border: 1px dashed var(--line); }
.pic.item { width: 28px; height: 28px; justify-self: center; }
.pic.item.none { visibility: hidden; }
.pic.skill { width: 26px; height: 26px; justify-self: center; }
.pic.sm { width: 26px; height: 26px; }
.pic.big { width: 96px; height: 96px; }
.pic.item.big, .pic.skill.big { width: 56px; height: 56px; }
.mapic { font-size: 24px; text-align: center; font-style: normal; }
.mapic.big { font-size: 56px; }

/* detail pages */
.detail .head { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.detail .head h2 { margin: 0; }
.detail .head p { margin: 2px 0 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 14px; }
.cols > section { padding: 4px 16px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.stats span { text-align: center; padding: 6px 0; border-radius: 10px; background: var(--hover); }
.stats small { display: block; color: var(--muted); font-size: 11px; }
.drops, .spawns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.drops li, .spawns li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 10px; background: var(--hover); }
.drops li b, .spawns li b { white-space: nowrap; }
.rate { color: #1c8a45; }
.ref { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); }
.ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref small { color: var(--muted); }
.ref i { font-style: normal; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.refs .ref { padding: 4px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.desc { white-space: normal; background: var(--hover); padding: 10px; border-radius: 10px; font-size: 14px; }
.shop { margin-bottom: 12px; padding: 4px 14px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; margin-top: 12px; }
table.grid th, table.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.grid th { background: var(--hover); color: var(--navy); font-family: var(--head); }
.plain { padding-left: 18px; }

@media (max-width: 700px) {
	.top { padding: 8px 10px; }
	.brand img { height: 32px; }
	#nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
	#nav a { white-space: nowrap; }
	main { padding: 12px 10px 30px; }
	.row { grid-template-columns: 40px minmax(0, 1fr) auto; }
	.row > .num, .row > .badge { display: none; }
	.cols { grid-template-columns: 1fr; }
	.stats { grid-template-columns: repeat(3, 1fr); }
}

/* a card's big picture of the game on its item page (wiki.js item: data-card) */
.detail .cardart { margin: 10px 0 4px; }
.detail .cardart img { display: block; width: 320px; max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

/* the Member page (wiki.js member) */
.member-lv5 { margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: rgba(243, 199, 78, 0.14); border: 1px solid rgba(243, 199, 78, 0.6); }
.member-lv5 h3 { margin: 0 0 6px; }
.member-lv5 ul { margin: 0; padding-left: 20px; line-height: 1.7; }
table.tbl.member { width: 100%; border-collapse: collapse; }
table.tbl.member th, table.tbl.member td { padding: 6px 8px; border-bottom: 1px solid rgba(127, 127, 127, 0.25); text-align: left; vertical-align: top; }
table.tbl.member .num { text-align: right; white-space: nowrap; }

/* ระบบในเกม (#/systems): the systems that are on, by group - the list on top jumps to one (2026-11-20) */
.sys-index { display: grid; gap: 8px; margin: 10px 0 6px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.sys-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sys-grp > b { flex: 0 0 150px; color: var(--muted); font: 600 13px var(--head); }
.sys-grp a { padding: 3px 11px; border-radius: 14px; background: var(--hover); border: 1px solid var(--line); color: var(--ink); font-size: 14px; white-space: nowrap; }
.sys-grp a:hover { text-decoration: none; border-color: var(--navy2); color: var(--navy2); }
h3.sys-cat { margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); font-size: 19px; }
.sys { scroll-margin-top: 72px; }
.sys p { margin: 6px 0; }
/* a system's picture: beside its text on a computer, over it on a phone; a tap opens the file (2026-11-20) */
.sys::after { content: ''; display: block; clear: both; }
.sys-fig { float: right; clear: right; width: min(44%, 420px); margin: 2px 0 10px 18px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(20, 40, 100, 0.14); line-height: 0; background: #10162a; }
.sys-fig img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; object-position: top; } /* (a tall window: its top - the whole of it a tap away) */
.sys-fig:hover { border-color: var(--navy2); }
.sys table.tbl, .sys .tbl-wrap, .sys .att-grid, .sys ul.sys-boss { clear: both; }
.sys li { margin: 3px 0; }
.sys-note { clear: both; margin: 10px 0 2px; padding: 6px 12px; border-radius: 8px; background: rgba(226, 167, 46, 0.14); border: 1px solid rgba(226, 167, 46, 0.5); font-size: 14px; }
.sys table.tbl { border-collapse: collapse; margin: 8px 0 4px; }
.sys table.tbl th, .sys table.tbl td { padding: 5px 12px 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sys table.tbl th { background: var(--hover); color: var(--navy); font: 600 13px var(--head); white-space: nowrap; }
.sys table.tbl .num { text-align: right; white-space: nowrap; }
.sys table.tbl td:first-child { white-space: nowrap; }
.sys-gift { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.sys-gift .ref { display: inline-flex; }
.sys-z { color: #b07a10; white-space: nowrap; }
.sys-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.sys-tiers span { padding: 2px 10px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); font-size: 13.5px; }
.sys-tiers small { color: var(--muted); }
.sys ul.sys-boss { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin: 8px 0 2px; padding: 0; }
.sys-boss li > span { color: var(--muted); font-size: 13px; text-align: right; }
@media (prefers-color-scheme: dark) { .sys-z { color: #f0c04a; } }
/* (a phone: the steps of a table one under the other - its three columns do not fit 350 px) */
@media (max-width: 700px) {
	.sys table.tbl.stack, .sys table.tbl.stack tbody, .sys table.tbl.stack tr, .sys table.tbl.stack td { display: block; }
	.sys table.tbl.stack tr:first-child { display: none; }
	.sys table.tbl.stack tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
	.sys table.tbl.stack td { padding: 1px 0; border: 0; }
}
@media (max-width: 700px) { .sys-fig { float: none; display: block; width: 100%; margin: 4px 0 10px; } .sys-grp > b { flex-basis: 100%; } .sys { scroll-margin-top: 150px; padding: 12px; } .sys table.tbl td:first-child { white-space: normal; } }
.sys { margin: 0 0 22px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.sys h3 { margin: 0 0 8px; }
.sys ul { margin: 6px 0 10px; padding-left: 20px; }
.sys code { padding: 0 5px; border-radius: 4px; background: rgba(90, 110, 170, 0.12); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.att { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); }
.att small { opacity: 0.7; }
.att .att-cash { align-self: flex-start; padding: 0 6px; border-radius: 4px; background: linear-gradient(#ffe9a0, #f2c24a); color: #6b4a00; font-size: 12px; }

/* the item grade's colours (the game's: client-debug/css/style.css .ig-1 ... .ig-4) */
.ig { font-weight: bold; } .ig-1 { color: #2b8a3e; } .ig-2 { color: #1971c2; } .ig-3 { color: #8e3ab0; } .ig-4 { color: #e07800; }
@media (prefers-color-scheme: dark) { .ig-1 { color: #5fd47a; } .ig-2 { color: #5aa9ff; } .ig-3 { color: #d38cf5; } .ig-4 { color: #ffb02e; } }
/* the item grade's bonus of each part (Noh 2026-10-22): scrolls sideways on a phone instead of the page */
.tbl-wrap { max-width: 100%; overflow-x: auto; }
table.tbl.grade { min-width: 520px; }
table.tbl.grade td, table.tbl.grade th { font-size: 12.5px; vertical-align: top; }
table.tbl.grade td:first-child { white-space: nowrap; }
