/* Game guide (doc/guide.md). Light, friendly look to match the game's windows. */
:root {
  --bg: #f4f1fd; --card: #ffffff; --text: #2f2a55; --muted: #6a6496; --line: #e3ddf7; --accent: #6a4df0;
  --gold: #c98a00; --head: linear-gradient(135deg, #8e7bff, #ff8ab5);
  font-family: "Noto Sans Thai", "Leelawadee UI", "Sarabun", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* a link inside running text is underlined, so it does not rely on colour alone (WCAG link-in-text-block) */
main p a:not([class]), main li a:not([class]), main td a:not([class]) { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; }

.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 8px 16px; background: var(--head); box-shadow: 0 2px 10px rgba(60, 40, 140, 0.25); }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 20px; text-decoration: none !important; }
.brand small { display: block; font-size: 11px; font-weight: 600; opacity: 0.9; }
.brand .crest { width: 38px; height: 38px; object-fit: contain; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; }
.top nav a { padding: 5px 11px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 14px; }
.top nav a:hover, .top nav a.on { background: rgba(255, 255, 255, 0.25); text-decoration: none; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
h1 { margin: 6px 0 4px; font-size: 28px; }
h2 { margin: 26px 0 10px; font-size: 21px; }
h2 small, h3 small { color: var(--muted); font-weight: 600; font-size: 0.7em; }
h3 { margin: 0; font-size: 17px; }
h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); text-transform: none; }
.lead { color: var(--muted); margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.crumb { margin: 0; font-size: 13px; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(80, 60, 160, 0.06); }
section.card { margin: 12px 0; }
section.card > h2:first-child, .sys > h3:first-child { margin-top: 2px; }
.card:target { outline: 3px solid #ffc94d; }
.card .head { display: flex; gap: 10px; align-items: center; }
.card p { margin: 6px 0; }
img.big { width: 52px; height: 52px; object-fit: contain; flex: none; }
img.mon { width: 72px; height: 72px; object-fit: contain; flex: none; }
img.ic { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 3px; }
img.sk { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.tags span { padding: 1px 8px; border-radius: 999px; background: #efeafe; color: #574f8f; font-size: 12px; }
.stats { font-weight: 700; color: #3b6fd8; font-size: 14px; }
.desc { color: #4d4777; font-size: 14px; }
ul.src { margin: 0; padding-left: 18px; font-size: 14px; }
ul.src li { margin: 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: #f6f3ff; border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.x { font-size: 12px; color: var(--muted); margin-right: 4px; }
.ch { display: inline-block; padding: 0 7px; margin-left: 2px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; vertical-align: 1px; }
.ch5 { background: #27854c; } .ch4 { background: #39833c; } .ch3 { background: #3678b4; } .ch2 { background: #8660cc; } .ch1 { background: #af601d; } .ch0 { background: #cd4242; }   /* white text 4.5:1+ */

.filter { position: sticky; top: 62px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; background: var(--bg); }
.filter input { flex: 1 1 220px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font: inherit; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hidden { display: none !important; }

.hero { display: flex; gap: 18px; align-items: center; padding: 18px; margin-bottom: 14px; border-radius: 18px; background: var(--head); color: #fff; }
.hero h1 { font-size: 30px; }
.herocrest { width: 110px; height: 110px; object-fit: contain; flex: none; }
.syslink { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none !important; transition: transform 0.1s; }
.syslink:hover { transform: translateY(-2px); border-color: var(--accent); }
.syslink span { color: var(--muted); font-size: 13px; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-top: 8px; }
.skill { display: flex; gap: 10px; padding: 8px; border-radius: 10px; background: #f8f6ff; }
.skill p { margin: 2px 0 0; font-size: 13px; }

/* system pages */
.sys table, .rank table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; background: #fff; }
.sys th, .sys td, .rank th, .rank td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.sys th, .rank th { background: #f1edff; font-size: 13px; }
.tip { padding: 8px 12px; border-left: 4px solid #ffc94d; background: #fff8e1; border-radius: 8px; font-size: 14px; }

/* rankings */
.castle { display: flex; gap: 14px; align-items: center; }
.castle .big { font-size: 40px; }
.rank td.num { width: 48px; font-weight: 800; color: var(--muted); }
.rank tr.top1 td.num { color: #e0a000; } .rank tr.top2 td.num { color: #8a94a8; } .rank tr.top3 td.num { color: #c27a3a; }
.fac { font-weight: 700; }
.fac-aetherion { color: #c99a00; } .fac-frostveil { color: #3a8fd0; } .fac-sylvaris { color: #3f9e35; }

@media (max-width: 640px) {
  .top { position: static; }
  .filter { top: 0; }
  .hero { flex-direction: column; text-align: center; }
  .grid, .skills { grid-template-columns: 1fr; }
}
