/* Project Zen: the client's login art (img/zen-bg.jpg) - a stormy violet night, lightning, embers and silver */
:root {
  --bg: #07060f;
  --shade: 12, 10, 28;           /* the art's night-sky shadow, as r, g, b for rgba() */
  --panel: rgba(16, 12, 34, .84);
  --panel-2: rgba(32, 23, 62, .86);
  --line: rgba(150, 110, 255, .22);
  --text: #ece9ff;
  --muted: #a8a0cc;
  --accent: #a46bff;             /* the ZEN violet */
  --accent-2: #5eb4ff;           /* the lightning */
  --accent-ink: #ffffff;
  --glow: rgba(164, 107, 255, .45);
  --gold: #f2b25c;               /* the braziers' embers */
  --danger: #ff6b6b;
  --link: #c4a8ff;
  --silver: linear-gradient(180deg, #ffffff 0%, #d9d6e6 45%, #9d97b5 100%);
  --display: "Cinzel", "Trajan Pro", "Palatino Linotype", Palatino, Georgia, serif;
  --radius: 10px;
  --always: #ffffff;
  --common: #3cd23c;
  --uncommon: #ffff00;
  --rare: #ff981f;
  --very-rare: #ff4040;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* the art stays put while the page scrolls over it (a fixed layer: works on phones, unlike background-attachment) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(var(--shade), .93) 0%, rgba(var(--shade), .8) 42%, rgba(var(--shade), .84) 70%, rgba(7, 6, 15, .96) 100%),
    url("img/zen-bg.jpg") center top / cover no-repeat,
    var(--bg);
}
/* the home page lets the logo and the scene through, darkening only further down */
body.home::before {
  background:
    linear-gradient(180deg, rgba(var(--shade), 0) 0%, rgba(var(--shade), .12) 40%, rgba(var(--shade), .7) 75%, rgba(7, 6, 15, .94) 100%),
    url("img/zen-bg.jpg") center top / cover no-repeat,
    var(--bg);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: #ddd0ff; }
a[title="Not written yet"] { color: var(--danger); }
::selection { background: rgba(164, 107, 255, .45); }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.4em 0 .5em; }
h1, h2, .card-title, .brand span { font-family: var(--display); letter-spacing: .03em; }
h1 { text-shadow: 0 2px 18px rgba(var(--shade), .9), 0 0 24px rgba(164, 107, 255, .25); }
h1 { font-size: 1.9rem; margin-top: .6em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3em; font-size: .9em; }
pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
pre code { border: 0; padding: 0; }
blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--accent); color: var(--muted); background: var(--panel); border-radius: 0 8px 8px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .4em 0 1em; }
details summary { cursor: pointer; }
.game { position: relative; width: 100%; aspect-ratio: 765 / 503; max-height: calc(100vh - 160px); min-height: 360px;
  background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.game-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0;
  padding: 24px; text-align: center; color: var(--muted); z-index: 1; pointer-events: none; }
.checksum { display: block; margin-top: 6px; word-break: break-all; }

/* top bar */
.topbar { background: rgba(var(--shade), .82); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(164, 107, 255, .12), 0 8px 30px rgba(0, 0, 0, .35); }
.topbar-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(164, 107, 255, .45), 0 0 14px var(--glow); }
.brand span { background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--text); background: rgba(164, 107, 255, .12); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(164, 107, 255, .2); box-shadow: inset 0 -2px 0 var(--accent); text-decoration: none; }
.search { flex: 1; min-width: 200px; }
.search input { width: 100%; }
.account { display: flex; align-items: center; gap: 10px; }
.account .who { font-weight: 500; }
.account form { margin: 0; }

/* forms */
input[type=text], input[type=search], textarea, select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font: inherit; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; box-shadow: 0 0 14px rgba(164, 107, 255, .3); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
label { display: block; font-weight: 600; margin: 1em 0 .3em; }
/* buttons: the login art's violet button with its silver rim */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink);
  background: linear-gradient(180deg, #9b5cff 0%, #6d2fd6 55%, #4c1d9e 100%);
  border: 1px solid rgba(220, 205, 255, .45); border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 0 1px rgba(0, 0, 0, .35), 0 4px 16px rgba(109, 47, 214, .35);
  transition: box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 0 1px rgba(0, 0, 0, .35), 0 0 22px var(--glow); }
.btn.secondary { background: rgba(var(--shade), .7); color: var(--text); border: 1px solid rgba(190, 170, 255, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); text-shadow: none; }
.btn.secondary:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(164, 107, 255, .25); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; text-shadow: none; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn-discord, .btn.btn-discord { background: linear-gradient(180deg, #6d78f7, #4752c4); border-color: rgba(200, 205, 255, .4); box-shadow: 0 4px 14px rgba(88, 101, 242, .3); }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
button.link:hover { color: var(--text); text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 1em 0; }
.inline { display: inline; margin: 0; }

.flash, .notice { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 8px; margin: 16px 0; }

/* page heads */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 24px 0 12px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin: 0; }
.crumbs { color: var(--muted); font-size: .9rem; margin-top: 20px; }
.crumbs a { color: var(--muted); }

/* home: the hero starts below the background's logo. The art is drawn "cover" from the top, so its scale is
   max(width / 1536, height / 1024) and the logo ends 424 px down the art: max(27.6vw, 41.4vh) down the window. */
.hero { padding: calc(max(27.6vw, 41.4vh) - 40px) 0 36px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0; }
.hero h1 span { background: linear-gradient(180deg, #e2c8ff, #a46bff 60%, #6f8bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #cfc8ec; max-width: 640px; margin: 12px auto 24px; font-size: 1.1rem; text-shadow: 0 1px 10px rgba(var(--shade), .95); }
.hero .actions { justify-content: center; }
.hero-logo { display: none; width: min(86vw, 400px); height: auto; margin: 0 auto 8px;
  -webkit-mask-image: radial-gradient(ellipse 50% 54% at 50% 46%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 54% at 50% 46%, #000 62%, transparent 100%); }
.wip { display: inline-block; background: rgba(242, 178, 92, .12); color: var(--gold); border: 1px solid rgba(242, 178, 92, .38); border-radius: 999px; padding: 3px 12px; font-size: .85rem; margin-bottom: 18px; backdrop-filter: blur(6px); }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0;
  backdrop-filter: blur(8px); box-shadow: 0 8px 28px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .04); }
.card h2, .card h3 { margin-top: 0; }
a.card { color: var(--text); display: block; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: rgba(164, 107, 255, .7); text-decoration: none; transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 22px rgba(164, 107, 255, .22); }
a.card .card-sub { color: var(--muted); font-size: .9rem; }
.card-title { font-weight: 700; font-size: 1.05rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 36px 0 12px; }
.section-title h2 { margin: 0; }

/* store */
.rank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rank-price { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--gold); text-shadow: 0 0 14px rgba(242, 178, 92, .35); }
.rank-perks { margin: 10px 0 6px; padding-left: 1.1em; font-size: .92rem; }
.rank-perks li { margin: .15em 0; }
.rank-perks.all { color: var(--muted); }
.rank-card details { margin-top: 4px; }
/* PayPal checkout panel */
.checkout { position: fixed; inset: 0; z-index: 50; background: rgba(4, 3, 10, .72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.checkout[hidden] { display: none; }
.checkout-box { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: rgba(16, 12, 34, .97); }
.checkout-box h2 { margin: 0 28px 6px 0; font-size: 1.2rem; }
.checkout-close { position: absolute; top: 10px; right: 12px; font-size: 1.1rem; }
.checkout-buttons { margin-top: 12px; min-height: 48px; background: #fff; border-radius: 8px; padding: 10px; color: #333; }
.checkout-buttons:empty { display: none; }
.checkout-message { margin: 12px 0 0; font-size: .92rem; }
.checkout-message:empty { display: none; }
.checkout-message.good { color: var(--common); }
.checkout-message.bad { color: var(--danger); }
.donate-row { flex-wrap: nowrap; }
.donate-row input { width: 90px; }
.donate-dollar { color: var(--muted); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.store-name { display: flex; gap: 8px; align-items: center; margin: 0; }
.store-name input { width: 190px; }
.store-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 18px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(var(--shade), .7); backdrop-filter: blur(8px); }
.store-tabs a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.store-tabs a:hover { color: var(--text); background: rgba(164, 107, 255, .12); text-decoration: none; }
.store-tabs a.active { color: #fff; background: rgba(164, 107, 255, .24); box-shadow: inset 0 -2px 0 var(--accent); }
.store-meta { margin-top: 10px; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.product-card { display: flex; flex-direction: column; gap: 4px; }
.product-card .actions { margin-top: auto; padding-top: 8px; }
.product-card.soon { opacity: .75; }
/* the Owner's Armory: gold-rimmed, like the art's embers */
.card.armory { border-color: rgba(242, 178, 92, .45); background: linear-gradient(160deg, rgba(60, 36, 12, .55), var(--panel) 55%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3), 0 0 18px rgba(242, 178, 92, .12); }
a.card.armory:hover { border-color: var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 24px rgba(242, 178, 92, .3); }
@media (max-width: 640px) {
  .store-name { width: 100%; }
  .store-name input { flex: 1; width: auto; }
  .store-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { background: var(--panel-2); font-size: .85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }
.prose th { background: var(--panel-2); }

.chance { font-weight: 700; }
.chance.always { color: var(--always); }
.chance.common { color: var(--common); }
.chance.uncommon { color: var(--uncommon); }
.chance.rare { color: var(--rare); }
.chance.very-rare { color: var(--very-rare); }

.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.tag.pet { color: var(--gold); border-color: rgba(233, 196, 106, .4); }
.tag.boss { color: var(--danger); border-color: rgba(255, 107, 107, .4); }
.tag.tier-Beginner { color: var(--common); }
.tag.tier-Hard { color: var(--rare); }
.tag.tier-Elite { color: var(--very-rare); }
.tag.donator { color: #c58cff; border-color: rgba(197, 140, 255, .4); }

/* wiki layout */
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.infobox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.infobox h2 { margin: 0; padding: 12px 16px; font-size: 1.05rem; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.infobox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.infobox dt, .infobox dd { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.infobox dt { color: var(--muted); font-size: .9rem; }
.infobox dd { text-align: right; font-weight: 500; }
.infobox dl > :nth-last-child(-n+2) { border-bottom: 0; }
.examine { font-style: italic; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stats table.data td.num.pos { color: var(--common); }
.stats table.data td.num.neg { color: var(--very-rare); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.filters input { max-width: 320px; }
.filters select { width: auto; }
.prose { max-width: 820px; }
.prose li { margin: .2em 0; }
.page-meta { color: var(--muted); font-size: .85rem; }

/* forums */
.forum-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 260px; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.forum-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.forum-row:last-child { border-bottom: 0; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.forum-list { border: 1px solid var(--line); border-radius: var(--radius); }
.forum-row .title { font-weight: 600; font-size: 1.02rem; }
.forum-row .desc { color: var(--muted); font-size: .9rem; }
.forum-row .count { text-align: center; color: var(--muted); font-size: .85rem; }
.forum-row .count strong { display: block; color: var(--text); font-size: 1rem; }
.forum-row .last { font-size: .85rem; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-row.pinned { background: linear-gradient(90deg, rgba(164, 107, 255, .16), var(--panel) 40%); }
.forum-list, .post, .infobox, .table-wrap, .flash, .notice, .mod-bar { backdrop-filter: blur(8px); }

.post { display: grid; grid-template-columns: 170px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; overflow: hidden; scroll-margin-top: 80px; }
.post .side { background: var(--panel-2); padding: 16px; text-align: center; border-right: 1px solid var(--line); }
.post .side .username { display: block; font-weight: 700; margin-top: 8px; word-break: break-word; }
.post .side .meta { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.post .main { padding: 14px 18px; min-width: 0; }
.post .head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.post .body { overflow-wrap: anywhere; }
.post .body > :first-child { margin-top: .5em; }
.post .tools { display: flex; gap: 12px; justify-content: flex-end; font-size: .85rem; margin-top: 10px; }
.post.deleted .body { color: var(--muted); font-style: italic; }
.avatar { border-radius: 50%; background: var(--panel-2); display: inline-block; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 72px; height: 72px; }
.username { color: var(--role, var(--text)); }
.role { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--role); border: 1px solid var(--role); margin-top: 6px; }
.thread-flags .tag { margin-right: 4px; }
.mod-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 16px; align-items: center; }
.mod-bar span { color: var(--muted); font-size: .85rem; margin-right: 4px; }

.preview { border: 1px dashed var(--accent); border-radius: var(--radius); padding: 4px 16px; margin: 16px 0; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.pager a, .pager span { padding: 4px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.pager a:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.pager .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pager .gap { border: 0; }

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 20px 0; background: rgba(7, 6, 15, .85); }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.error-page { text-align: center; padding: 80px 0; }
.error-page .code { font-size: 4rem; font-weight: 800; color: var(--accent); line-height: 1; font-family: var(--display); text-shadow: 0 0 30px var(--glow); }

@media (max-width: 900px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-layout .infobox { order: -1; }
  .forum-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .forum-row .last { display: none; }
}
@media (max-width: 640px) {
  /* the header wraps to three rows here: let it scroll away, nav in one row that scrolls sideways */
  .topbar { position: static; }
  .topbar-inner { gap: 10px; }
  .account { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: none; }
  .search { order: 5; flex-basis: 100%; }
  /* home: the header sits over the background's logo, so the logo is an image in the hero instead */
  body.home::before {
    background:
      linear-gradient(180deg, rgba(var(--shade), .93) 0%, rgba(var(--shade), .88) 42%, rgba(var(--shade), .6) 60%, rgba(var(--shade), .78) 82%, rgba(7, 6, 15, .94) 100%),
      url("img/zen-bg.jpg") center top / cover no-repeat,
      var(--bg);
  }
  .hero { padding-top: 16px; }
  .hero-logo { display: block; }
  .account .who { display: none; }
  .post { grid-template-columns: 1fr; }
  .post .side { display: flex; gap: 10px; align-items: center; text-align: left; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .post .side .username { margin-top: 0; }
  .post .side .avatar.lg { width: 36px; height: 36px; }
  .post .side .meta { margin-top: 0; }
  .forum-row { grid-template-columns: 1fr; gap: 4px; }
  .forum-row .count { text-align: left; }
  .forum-row .count strong { display: inline; }
  .grid.cols-2 { grid-template-columns: 1fr; }
}
