/* Beyond The Horizon Wiki: navy seas around a parchment page, brass trim. */
:root {
  --navy: #0b1a2b; --navy2: #12283f; --deep: #07111c; --sea: #1d4e6e; --foam: #e8f1f5;
  --parch: #f4e8cb; --parch2: #e8d6ad; --line: #c8b184; --ink: #2b2014; --ink2: #6b3f10;
  --brass: #c79a3b; --gold: #e8c26a; --link: #8a3f0c; --dim: #7a6a52;
  --common: #3f7d3a; --uncommon: #2f6aa6; --rare: #8a3fb0; --vrare: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(ellipse at top, #16324f 0%, var(--navy) 45%, var(--deep) 100%) fixed; color: var(--ink);
  font: 17px/1.55 "Crimson Text", Georgia, serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: Cinzel, Georgia, serif; color: var(--ink2); letter-spacing: .02em; }
h2 { border-bottom: 2px solid var(--line); padding-bottom: 3px; margin: 1.4em 0 .6em; font-size: 1.35em; clear: left; }
h3 { font-size: 1.08em; margin: 1em 0 .4em; }
kbd { font: 600 .82em Consolas, monospace; background: #fff8e6; border: 1px solid #a88a58; border-bottom-width: 3px; border-radius: 4px; padding: 0 5px; }
.dim { color: var(--dim); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 6px 18px;
  background: linear-gradient(#0b1a2bf2, #0b1a2be6); border-bottom: 2px solid var(--brass); box-shadow: 0 4px 16px #0008; }
.logo img { height: 54px; display: block; border-radius: 7px; border: 1px solid #c79a3b88; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 12px; border-radius: 20px; border: 1px solid var(--brass); background: #0f2236; color: var(--foam); font: inherit; }
#sugg { position: absolute; top: 100%; left: 0; right: 0; background: var(--parch); border: 1px solid var(--rope, #8a6a3a); border-radius: 8px; margin-top: 4px;
  box-shadow: 0 10px 24px #0009; display: none; max-height: 70vh; overflow: auto; }
#sugg a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; color: var(--ink); }
#sugg a small { color: var(--dim); }
#sugg a.sel, #sugg a:hover { background: #e2cd9b; text-decoration: none; }
.site { display: flex; gap: 4px; margin-left: auto; }
.site a { font: 700 14px Cinzel, serif; color: var(--parch); padding: 7px 11px; border-radius: 6px; }
.site a.on, .site a:hover { background: #c79a3b22; color: var(--gold); text-decoration: none; }
html.local .webonly { display: none; }
#menu { display: none; background: none; border: 1px solid var(--brass); color: var(--gold); font-size: 20px; border-radius: 6px; cursor: pointer; }

/* Layout */
.wrap { display: flex; max-width: 1400px; margin: 0 auto; gap: 0; }
.side { width: 210px; flex: none; padding: 14px 10px 30px 14px; position: sticky; top: 70px; align-self: flex-start; max-height: calc(100vh - 70px); overflow: auto; }
.navgroup { margin-bottom: 12px; }
.navgroup h4 { color: var(--gold); margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.navgroup a { display: block; color: var(--parch); font-size: 15px; padding: 1px 6px; border-radius: 4px; }
.navgroup a:hover { background: #ffffff14; color: #fff; text-decoration: none; }
.content { flex: 1; min-width: 0; background: linear-gradient(var(--parch), #efe0bb); margin: 14px 14px 30px 0; padding: 18px 28px 20px;
  border: 1px solid #8a6a3a; border-radius: 10px; box-shadow: 0 10px 30px #0008, inset 0 0 60px #c9a86a44; }
.crumbs { font-size: .9em; color: var(--dim); }
.ptitle { margin: .2em 0 .5em; font-size: 2em; border-bottom: 3px double var(--line); padding-bottom: 6px; }
.pfoot { margin-top: 30px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: .85em; clear: both; }
.note { background: #fff5d6; border-left: 4px solid var(--brass); padding: 8px 12px; border-radius: 4px; }
.examine { font-style: italic; color: #5b4a33; }
blockquote.say { margin: 6px 0; padding: 6px 12px; border-left: 3px solid var(--line); background: #fffaeb; font-style: italic; }

/* Infobox */
.infobox { float: right; width: 300px; margin: 0 0 14px 20px; background: #fbf3de; border: 1px solid #a88a58; border-radius: 8px; overflow: hidden; font-size: .92em;
  box-shadow: 0 3px 10px #0002; }
.ib-title { background: linear-gradient(#1d4e6e, #12283f); color: var(--gold); font: 700 1.05em Cinzel, serif; text-align: center; padding: 7px; }
.ib-img { background: radial-gradient(#2a6a8f, #0b1a2b); text-align: center; padding: 6px; }
.ib-img img { max-width: 100%; max-height: 280px; display: block; margin: 0 auto; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { padding: 4px 8px; border-top: 1px solid #e0cc9c; text-align: left; vertical-align: top; }
.infobox th { width: 42%; background: #f1e2bd; font-weight: 600; }
.toc { display: inline-block; background: #fbf3de; border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; margin: 4px 0 10px; }
.toc b { display: block; font-family: Cinzel, serif; color: var(--ink2); }
.toc a { display: inline-block; margin-right: 12px; }

/* Tables */
.tbl { overflow-x: auto; margin: 8px 0 14px; }
table.wt { border-collapse: collapse; width: 100%; background: #fbf3de; font-size: .93em; }
table.wt th { background: linear-gradient(#1d4e6e, #12283f); color: var(--gold); font: 700 .85em Cinzel, serif; text-align: left; padding: 6px 8px; white-space: nowrap; }
table.sortable th { cursor: pointer; }
table.sortable th::after { content: " ⇅"; opacity: .5; font-size: .8em; }
table.wt td { padding: 4px 8px; border-bottom: 1px solid #e3cf9f; vertical-align: middle; }
table.wt tbody tr:nth-child(even) { background: #f5e9cc; }
table.wt tbody tr:hover { background: #ecdcb2; }
.r { font-weight: 700; padding: 1px 8px; border-radius: 10px; color: #fff; font-size: .88em; white-space: nowrap; }
.r.common { background: var(--common); } .r.uncommon { background: var(--uncommon); } .r.rare { background: var(--rare); }
.r.vrare { background: var(--vrare); } .r.always { background: #5c4a2c; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; border: 1px solid #0004; }
input.filter { width: 100%; max-width: 360px; padding: 7px 10px; font: inherit; border: 1px solid #a88a58; border-radius: 6px; background: #fffaf0; margin: 6px 0; }

/* Links with little pictures */
a.ln { white-space: nowrap; }
img.ico { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a.ln { background: #fbf3de; border: 1px solid var(--line); border-radius: 16px; padding: 2px 10px 2px 4px; }
ul.cols { columns: 3 220px; }

/* Galleries */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.gallery.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery a { display: flex; flex-direction: column; background: #fbf3de; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; color: var(--ink); }
.gallery a:hover { box-shadow: 0 4px 12px #0003; text-decoration: none; border-color: var(--brass); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; background: radial-gradient(#2a6a8f, #0b1a2b); }
.gallery.wide img { aspect-ratio: 16/9; object-fit: cover; }
.gallery span { padding: 5px 8px; font-weight: 600; font-size: .92em; }
.gallery small { display: block; font-weight: 400; color: var(--dim); font-size: .85em; }

/* Abilities */
.abil { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.acard { display: flex; gap: 10px; align-items: flex-start; background: #fbf3de; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--ink); }
.acard:hover { border-color: var(--brass); text-decoration: none; }
.acard img { width: 56px; height: 56px; border-radius: 8px; flex: none; }
.acard p { margin: 2px 0; font-size: .9em; }
.acard small { color: var(--dim); }
.bossbox, .course { display: flex; gap: 14px; align-items: flex-start; }
.bossbox > img { width: 160px; border-radius: 8px; background: radial-gradient(#2a6a8f, #0b1a2b); flex: none; }
.course > img { width: 360px; max-width: 45%; border-radius: 8px; flex: none; border: 1px solid var(--line); }
.bossbox > div, .course > div { flex: 1; min-width: 0; }

/* Main page */
.hero { display: flex; gap: 20px; align-items: center; background: linear-gradient(#12283f, #0b1a2b); color: var(--foam); border-radius: 10px; padding: 16px; }
.hero img { width: 300px; max-width: 40%; border-radius: 10px; }
.hero .lead { font-size: 1.15em; }
.btn { display: inline-block; font: 700 15px Cinzel, serif; background: linear-gradient(#e2b857, #a97a26); color: #231607; border: 1px solid #6b4a14; padding: 8px 16px; border-radius: 7px; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold); border-color: var(--brass); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 14px 0; text-align: center; }
.statgrid div { background: #fbf3de; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.statgrid b { display: block; font: 800 1.5em Cinzel, serif; color: var(--ink2); }
.portals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.portal { display: flex; flex-direction: column; align-items: center; background: linear-gradient(#1d4e6e, #0b1a2b); border: 1px solid var(--brass); border-radius: 10px; padding: 8px; color: var(--gold); }
.portal img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.portal b { font-family: Cinzel, serif; padding-top: 6px; }
.portal:hover { text-decoration: none; filter: brightness(1.12); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.panel { background: #fbf3de; border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px; }
.panel h2 { margin-top: .6em; }
#results a { display: block; padding: 6px 0; border-bottom: 1px dashed var(--line); }
#results small { color: var(--dim); margin-left: 8px; }

@media (max-width: 900px) {
  .side { display: none; position: fixed; inset: 66px 0 0 0; background: var(--navy); z-index: 30; width: auto; max-height: none; }
  body.menu .side { display: block; }
  #menu { display: block; }
  .site { display: none; }
  .content { margin: 10px; padding: 14px; }
  .infobox { float: none; width: 100%; margin: 0 0 12px; }
  .course, .bossbox, .hero { flex-direction: column; }
  .course > img, .hero img { max-width: 100%; width: 100%; }
}
.site a.yt { background: #d8002a; color: #fff; }
.site a.yt:hover { background: #ff1f47; color: #fff; }
a.ytl { color: #c4001f; font-weight: 600; }
