/* L2 Toxicity. Palette from the brand sheet (web/README.md): ink and slate surfaces, bone for headings and links,
   crimson for actions, as in the logo's red blade on metal. Venom green marks only what is up, alive or online;
   a light red what is down, dead or wrong (kept apart from the brand crimson). */

@font-face { font-family: "Cormorant"; src: url("fonts/cormorant.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
	--night: #1e252d;      /* page: brand ink */
	--hull: #27303b;       /* raised surfaces */
	--hull-deep: #151a21;  /* insets, item slots */
	--seam: #3b4756;       /* lines: brand slate, darkened */
	--cloud: #ece7e1;      /* text */
	--haze: #9ba7b5;       /* secondary text: brand slate, lightened */
	--bone: #e6d4c6;       /* headings, links, trim */
	--bone-dim: #8c7f74;
	--crimson: #aa1b1d;    /* actions: the logo's blade */
	--crimson-deep: #6a0a0e;
	--venom: #8fd16a;      /* up, alive, online */
	--blood: #ff6f62;      /* down, dead, errors: lighter than the brand crimson */
	--amber: #e7b25a;      /* warnings */
	--display: "Cormorant", "Cormorant Garamond", Georgia, serif;
	--text: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
	color-scheme: dark;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--night) linear-gradient(180deg, #27313d 0, var(--night) 420px) no-repeat;
	color: var(--cloud);
	font: 17px/1.55 var(--text);
	font-variant-numeric: lining-nums;
}

a { color: var(--bone); text-decoration-color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #f4e7dc; }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }

h1, h2, h3 { font-weight: 600; color: var(--cloud); margin: 0 0 .5em; line-height: 1.15; }
h1 { font: 600 2.4rem/1.1 var(--display); }
h2 { font: 600 1.7rem/1.15 var(--display); color: var(--bone); }
h3 { font: 700 1.05rem/1.3 var(--text); }
h1 small, h2 small { font: 400 1rem var(--text); color: var(--haze); }
h1, h2, h3, .rates { text-wrap: balance; }
[id] { scroll-margin-top: 16px; }
a, button, .chip, .tab, summary { touch-action: manipulation; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--bone); color: var(--night); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:focus { outline: none; }
.lead-in { max-width: 62ch; color: var(--haze); font-size: 1.05rem; }
p { margin: 0 0 1em; }

/* Header */
.top {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
	max-width: 1180px; margin: 0 auto; padding: 10px 16px; border-bottom: 1px solid var(--seam);
}
.top-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-gap { width: 1px; height: 18px; background: var(--seam); }
.brand { display: block; line-height: 0; }
.brand img { display: block; height: 44px; width: auto; }
nav { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
nav a { color: var(--cloud); text-decoration: none; }
nav a:hover { color: var(--bone); }
nav .gm-link { color: var(--venom); }
nav form { margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--cloud); font: inherit; cursor: pointer; }
button.link:hover { color: var(--bone); }
button.link small { color: var(--haze); }

main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 56px; }
footer { max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; border-top: 1px solid var(--seam); color: var(--haze); font-size: .85rem; }

/* Buttons */
.button, button[type=submit]:not(.link) {
	display: inline-block; padding: 9px 20px; font: 700 1rem var(--text); color: #fff4ec; cursor: pointer; text-decoration: none;
	background: linear-gradient(#b8221f, #8a1416); border: 1px solid #d1453f; border-radius: 2px; box-shadow: 0 1px 0 #000;
}
.button:hover, button[type=submit]:not(.link):hover { background: linear-gradient(#c92a26, #9a181a); color: #fff; }
.button.quiet { background: transparent; color: var(--bone); border-color: var(--bone-dim); box-shadow: none; }
.button.quiet:hover { background: rgba(230, 212, 198, .08); color: #f4e7dc; }
.button.small { padding: 4px 12px; font-size: .9rem; }
nav .button.small { color: #fff4ec; }
button[type=submit]:not(.link) { margin-top: 14px; }
button.danger[type=submit]:not(.link) { background: transparent; color: var(--blood); border-color: #7a3430; box-shadow: none; }
button:disabled, button[type=submit]:disabled { opacity: .45; cursor: not-allowed; }

/* Forms */
label { display: block; margin: 12px 0 4px; color: var(--haze); font-size: .95rem; }
input, select, textarea {
	display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; font-size: 1rem; color: var(--cloud);
	background: var(--hull-deep); border: 1px solid var(--seam); border-radius: 2px;
}
select { width: auto; padding: 7px 9px; background-color: var(--hull-deep); color: var(--cloud); }
option { background-color: var(--hull-deep); color: var(--cloud); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bone); }
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin-top: 8px; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-actions button[type=submit] { margin-top: 0; }
.form-actions .danger { margin-left: auto; }

/* Surfaces */
.card { background: var(--hull); border: 1px solid var(--seam); border-radius: 2px; padding: 22px; }
.narrow { max-width: 460px; margin: 0 auto; }
.hint { color: var(--haze); font-size: .9rem; }
.center { text-align: center; }
.dim { color: var(--haze); }
.warn { color: var(--amber); }
.online { color: var(--venom); font: 500 .9rem var(--text); }
.back { margin: 0 0 14px; font-size: .95rem; }
.flash { padding: 10px 14px; border-left: 3px solid var(--seam); background: var(--hull); }
.flash.error { border-color: var(--blood); }
.flash.ok { border-color: var(--venom); }
.flash.gm { border-color: var(--bone); }

/* Join page */
.hero.small { padding: 8px 0 16px; }
.hero.small h1 { font-size: 2.6rem; }
.hero.small p { max-width: 60ch; color: var(--haze); }

/* Home. The key art is the loud thing: full width under the header, with the logo painted in. The live status sits
   right under it, quieter but still large, then the feature cards. */
.hero-art { position: relative; margin: 0; background: #0c1016; overflow: hidden; }
/* Home: the header floats over the art, which starts at the very top of the page. A dark fade behind the menu keeps
   it readable on the bright sky; the art carries the big logo, so the small one is hidden here. */
.home .top { position: absolute; top: 0; left: 0; right: 0; z-index: 20; border-bottom: 0; }
.home .brand { visibility: hidden; }
.home .top nav a, .home .top button.link { text-shadow: 0 1px 3px rgba(0, 0, 0, .85); }
.home .hero-art::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; z-index: 1; background: linear-gradient(180deg, rgba(8, 11, 16, .75), rgba(8, 11, 16, 0)); pointer-events: none; }
.hero-art img { display: block; width: 100%; height: auto; min-height: 240px; max-height: 640px; object-fit: cover; object-position: 33% 50%; }
.hero-art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(180deg, rgba(30, 37, 45, 0), var(--night)); pointer-events: none; }
.signal { display: inline-block; width: .42em; height: .42em; border-radius: 50%; vertical-align: .12em; margin-right: .4em; }
.is-up .signal { background: var(--venom); box-shadow: 0 0 0 0 rgba(143, 209, 106, .6); animation: signal 2.4s ease-out 3; }
.is-down .signal { background: var(--blood); }
@keyframes signal { 0% { box-shadow: 0 0 0 0 rgba(143, 209, 106, .6); } 100% { box-shadow: 0 0 0 .45em rgba(143, 209, 106, 0); } }
.intro { padding-bottom: 28px; border-bottom: 1px solid var(--seam); margin-bottom: 26px; }
.rates { max-width: 52ch; margin: 0; font: 600 1.6rem/1.3 var(--display); color: var(--cloud); }
.rate-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); margin: 16px 0 0; border-top: 1px solid var(--seam); border-bottom: 1px solid var(--seam); }
.rate-strip div { display: flex; flex-direction: column-reverse; padding: 10px 12px 8px; border-left: 1px solid var(--seam); }
.rate-strip div:first-child { border-left: 0; padding-left: 0; }
.rate-strip dd { margin: 0; font: 600 2.1rem/1 var(--display); color: var(--bone); font-variant-numeric: lining-nums; }
.rate-strip dt { margin-top: 4px; color: var(--haze); font-size: .9rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }

/* The five feature cards from the brand sheet. Their labels are painted in, so the links carry them as text too. */
.features { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 0 28px; }
.feature { display: block; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px #3a3530, 0 6px 16px rgba(5, 8, 12, .4); }
.feature img { display: block; width: 100%; height: auto; transition: transform .25s ease, filter .25s ease; }
.feature:hover img, .feature:focus-visible img { transform: scale(1.03); filter: brightness(1.12); }
.cta + .hint { margin-top: 12px; }

.home-aside h2, .news-list h2, .how h2 { font-size: 1.5rem; }
/* One card per game server, like the server lists of bigger L2 sites. */
.server-card { padding: 12px 16px 8px; margin-bottom: 10px; background: var(--hull); border: 1px solid #46525f; border-left: 3px solid var(--seam); border-radius: 3px; }
.server-card.is-up { border-left-color: var(--venom); }
.server-card.is-down { border-left-color: var(--blood); }
.server-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.server-head h3 { margin: 0; font: 600 1.45rem/1.1 var(--display); color: var(--cloud); }
.server-rate { color: var(--bone); }
.server-badge { font-weight: 700; font-size: .85rem; padding: 1px 9px; border-radius: 10px; white-space: nowrap; }
.is-up .server-badge { color: #10200a; background: var(--venom); }
.is-down .server-badge { color: #2a0705; background: var(--blood); }
.server-chronicle { margin: 2px 0 6px; color: var(--haze); font-size: .9rem; }
.server-totals { margin-top: 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(52, 80, 110, .55); }
.rows li:last-child { border-bottom: 0; }
.rows small { color: var(--haze); }
.rows b { font-weight: 500; font-variant-numeric: tabular-nums; }
.state { font-weight: 500; white-space: nowrap; }
.state.up { color: var(--venom); }
.state.down { color: var(--blood); }
.owner { color: var(--bone); }

.home-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding: 0 0 32px; }
.home-main { min-width: 0; }
.home-aside { display: grid; gap: 28px; align-content: start; }
.news-list { max-width: 72ch; }
.post + .post { margin-top: 26px; }
.post-title { font: 600 1.55rem/1.15 var(--display); margin: 0 0 2px; }
.post-title a { color: var(--cloud); text-decoration: none; }
.post-title a:hover { color: var(--bone); }
.post-meta { margin: 0 0 8px; color: var(--haze); font-size: .9rem; }
.post-body p { margin: 0 0 .8em; }
.how { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--seam); max-width: 72ch; }
.steps { margin: 0; padding-left: 1.4em; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { color: var(--bone); font: 600 1.25rem var(--display); }
.download-card { margin: 8px 0 30px; padding: 18px 22px 8px; background: var(--hull); border: 1px solid #46525f; border-left: 3px solid var(--crimson); border-radius: 3px; }
.download-card h2 { margin-top: 0; }
.tips { padding-left: 1.2em; }
.tips li { margin-bottom: 8px; }
.reading section + section { margin-top: 26px; }

/* Bosses */
.boss-section { margin-top: 28px; }
.boss-rows { max-width: 640px; }
.boss-bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px 32px; }
.boss-band h3 { margin: 14px 0 4px; font: 600 1.25rem var(--display); color: var(--bone); }
.boss-band h3 small { font: 400 .85rem var(--text); color: var(--haze); }
.boss-band .rows li { padding: 4px 0; font-size: .95rem; }
.filter-links { display: flex; gap: 18px; margin: 0 0 6px; }
.filter-links a { text-decoration: none; color: var(--haze); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.filter-links a:hover { color: var(--cloud); }
.filter-links a[aria-current] { color: var(--cloud); border-bottom-color: var(--crimson); }

/* Page headers (templates/_hero.html). Media pack 02's banners are ~490 px crops, so the plate shows them near that
   size in a metal frame; the same image, blurred and darkened, fills the band behind, where its softness doesn't show. */
.page-hero { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--seam); background: #10151e; }
.page-hero-glow { position: absolute; inset: -40px; z-index: -1; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) saturate(1.15) brightness(.55); }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(16, 21, 30, .88) 0, rgba(16, 21, 30, .55) 55%, rgba(16, 21, 30, .25)), linear-gradient(180deg, rgba(16, 21, 30, 0) 60%, var(--night)); }
.page-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 490px); align-items: center; gap: 24px 40px; max-width: 1180px; margin: 0 auto; padding: 34px 16px 30px; }
.page-hero-text { min-width: 0; }
.page-hero h1 { margin-bottom: .3em; font-size: clamp(2.2rem, 4.2vw, 3.1rem); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.page-hero .lead-in { color: #c3ccd6; margin-bottom: .6em; }
.page-hero .cta { margin-top: 14px; }
.page-hero-plate { position: relative; margin: 0; line-height: 0; border-radius: 3px; overflow: hidden;
	box-shadow: 0 0 0 1px #8c7f74, 0 0 0 4px #1a2029, 0 0 0 5px #4b4239, 0 16px 36px rgba(0, 0, 0, .55); }
.page-hero-plate img { display: block; width: 100%; height: auto; aspect-ratio: 490 / 116; object-fit: cover; }
/* A soft inner vignette blends the crop's own painted border into the frame. */
.page-hero-plate::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 18px rgba(0, 0, 0, .55); pointer-events: none; }
.hero-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: .95rem; }
.hero-links a { color: var(--bone); text-decoration: none; border-bottom: 1px solid rgba(170, 27, 29, .7); }
.hero-links a:hover { color: #f4e7dc; border-bottom-color: #d1453f; }

/* Boss portraits: concept art from media pack 02 with the name painted at the bottom, which the frame crops off
   (the name is in the text next to it). */
.portrait { display: block; flex: none; overflow: hidden; background: #0c1016; border-radius: 3px; box-shadow: 0 0 0 1px #4b4239; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.portrait.big { width: 96px; height: 112px; }
.portrait.small { width: 30px; height: 34px; }
/* No art for this boss: its initial on a dark plate instead. */
.portrait-initial { display: flex; align-items: center; justify-content: center; height: 100%; background: radial-gradient(circle at 50% 40%, #2a333f, #10151e 75%);
	font: 600 2.6rem/1 var(--display); color: var(--bone-dim); }
.portrait.small .portrait-initial { font-size: 1.1rem; }
.rows li:has(> .with-portrait) { align-items: center; }
.with-portrait { display: inline-flex; align-items: center; gap: 10px; }
.epic-cards { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.epic-card { display: flex; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; background: var(--hull); border: 1px solid #46525f; border-left: 3px solid var(--seam); border-radius: 3px; }
.epic-card.is-alive { border-left-color: var(--venom); }
.epic-card.is-open { border-left-color: var(--amber); }
.epic-card.is-dead { border-left-color: var(--blood); }
.epic-card.is-dead .portrait img { filter: grayscale(.75) brightness(.7); }
.epic-text { min-width: 0; }
.epic-text h3 { margin: 0; font: 600 1.45rem/1.1 var(--display); color: var(--cloud); }
.epic-text p { margin: 2px 0 0; }
.epic-text .dim { font-size: .9rem; }
.epic-text .state { white-space: normal; }
.epic-when { color: var(--haze); font-size: .88rem; }
.home-aside .with-portrait { gap: 8px; }

/* Server info */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 32px; margin: 0 0 28px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(52, 80, 110, .55); }
.facts dt { color: var(--haze); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-table { max-width: 480px; margin-top: 8px; }
.price-table caption { text-align: left; padding-bottom: 6px; }
.price-table tfoot td { font-weight: 700; border-top: 1px solid var(--seam); border-bottom: 0; }

/* Join page: the wide brand banner above the forms */
.join-banner { margin: 0 0 22px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px #46525f, 0 12px 30px rgba(5, 8, 12, .45); }
.join-banner img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; object-position: 50% 45%; }
code.secret { font: 700 1.15rem var(--text); letter-spacing: .06em; color: var(--cloud); background: var(--hull-deep); padding: 1px 8px; border-radius: 2px; user-select: all; }

/* News page */
.reading { max-width: 760px; margin: 0 auto; }
.post-window + .post-window { margin-top: 16px; }
.post-window .window-title a { color: var(--cloud); text-decoration: none; }
.pager { display: flex; gap: 20px; justify-content: center; align-items: center; margin-top: 24px; color: var(--haze); }

/* Game-style windows: the character page mirrors the client's own panels, framed in bronze. */
.window { background: var(--hull); border: 1px solid #46525f; border-radius: 3px; box-shadow: inset 0 0 0 1px #0d1724, 0 8px 24px rgba(5, 10, 18, .35); }
.window-title {
	margin: 0; padding: 7px 14px; font: 600 1.25rem/1.2 var(--display); color: var(--bone);
	background: linear-gradient(#2c1e21, #1d1518); border-bottom: 1px solid #5a1d1f; border-radius: 2px 2px 0 0;
}
.window-body { padding: 14px 16px; }
main > .window + .window { margin-top: 16px; }

/* Character list */
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.char { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; color: var(--cloud); text-decoration: none; }
.char:hover { border-color: var(--bone); color: var(--cloud); }
.char .name { font: 600 1.6rem/1.1 var(--display); color: var(--bone); }
.char .meta { color: var(--haze); font-size: .9rem; }

/* Character page */
.char-head { margin-bottom: 16px; }
.head-body { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.char-head h1 { margin: 0; font-size: 2.8rem; }
.char-head .title { margin: 0; color: #ecf9a2; }
.char-head .meta { margin: 2px 0 0; color: var(--haze); }
.char-head .clan { color: var(--cloud); }
.purse { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.coin { display: inline-flex; align-items: center; gap: 8px; color: var(--haze); }
.coin img { border: 1px solid #000; border-radius: 2px; }
.coin b { color: var(--cloud); font-weight: 700; font-variant-numeric: tabular-nums; }

.char-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.char-grid.with-detail { grid-template-columns: minmax(270px, 1fr) auto minmax(270px, 1fr); }
.bars { display: grid; gap: 7px; margin-bottom: 12px; }
.bar { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; margin: 0; font-size: .82rem; color: var(--cloud); }
.bar-name { color: var(--haze); font-weight: 700; }
.bar-val { font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 11px; border: 1px solid #000; border-radius: 2px; background: #0a1220; box-shadow: 0 0 0 1px #2c4058; }
progress::-webkit-progress-bar { background: #0a1220; }
.cp progress::-webkit-progress-value { background: linear-gradient(#f0c35c, #a2741f); } .cp progress::-moz-progress-bar { background: #c99a3c; }
.hp progress::-webkit-progress-value { background: linear-gradient(#ef5b51, #9c211c); } .hp progress::-moz-progress-bar { background: #c43a33; }
.mp progress::-webkit-progress-value { background: linear-gradient(#5d9cf0, #1f4c98); } .mp progress::-moz-progress-bar { background: #3a70c4; }
.exp progress::-webkit-progress-value { background: linear-gradient(#e2e8f0, #7d8ca0); } .exp progress::-moz-progress-bar { background: #aab5c4; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 18px; margin: 0 0 10px; padding: 10px 0 0; border-top: 1px solid var(--seam); }
.stat-grid div { display: flex; justify-content: space-between; gap: 8px; }
.stat-grid dt { color: var(--haze); font-size: .9rem; }
.stat-grid dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.stat-grid.base { grid-template-columns: repeat(3, 1fr); }
.attrs { margin: 5px 0; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.attr-label { color: var(--haze); min-width: 60px; }

/* Item cells */
.cell {
	position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none;
	background: var(--hull-deep); border: 1px solid #2f4560; border-radius: 3px; box-shadow: inset 0 0 0 1px #000, inset 0 0 8px rgba(0, 0, 0, .7);
	text-decoration: none;
}
.cell img { width: 40px; height: 40px; display: block; border-radius: 2px; }
a.cell:hover, a.cell:focus-visible { border-color: var(--bone); outline: none; z-index: 5; }
.cell.chosen { border-color: var(--bone); box-shadow: 0 0 0 1px var(--bone), 0 0 10px rgba(230, 212, 198, .35); }
.cell[hidden] { display: none; }
.cell.g-d { border-color: #3c5068; } .cell.g-c { border-color: #33573e; } .cell.g-b { border-color: #2c4f75; }
.cell.g-a { border-color: #6a5a2c; } .cell.g-s, .cell.g-s80, .cell.g-s84 { border-color: #7a3a36; }
.badge-enchant, .badge-count { position: absolute; font: 700 11px/1 var(--text); text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000; pointer-events: none; }
.badge-enchant { top: 3px; left: 3px; color: #9fd8ff; }
.badge-count { right: 3px; bottom: 3px; color: #fff; }
.cell.empty { background: #17263a; border-style: dashed; border-color: #2f4560; box-shadow: none; }
.cell.filler { background: #111d2c; border-color: #1d2c3f; box-shadow: none; }
.slot-name { font-size: 9px; line-height: 1.05; color: #5f7896; text-align: center; padding: 2px; overflow: hidden; }
.cell.big { width: 74px; height: 74px; }
.cell.big img { width: 64px; height: 64px; }

.tip {
	display: none; position: absolute; left: 50px; top: -2px; z-index: 10; width: 260px; padding: 9px 11px;
	background: rgba(6, 10, 16, .96); border: 1px solid #5a6a80; border-radius: 3px; box-shadow: 0 8px 22px rgba(0, 0, 0, .7);
	font-size: .82rem; line-height: 1.4; text-align: left; pointer-events: none; color: var(--cloud);
}
a.cell:hover .tip, a.cell:focus-visible .tip { display: block; }
.d-name { display: block; font-size: .9rem; font-weight: 700; color: #fff; margin-bottom: 3px; }
.d-line { display: block; color: var(--haze); }
.d-line b { color: var(--cloud); }
.detail .d-name { font-size: 1.1rem; }
.detail .d-line { font-size: .9rem; }

.paperdoll { display: grid; gap: 6px; justify-items: center; padding: 12px; background: radial-gradient(ellipse at 50% 40%, #33404f 0, #171d25 72%); border: 1px solid #0d1724; border-radius: 3px; }
.pd-row { display: flex; gap: 6px; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.detail-text { min-width: 0; }
.detail h3 { margin-top: 18px; color: var(--bone); }
.enchant-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.enchant-form label { margin: 0; }
.enchant-form select { display: block; margin-top: 4px; }
.enchant-form button[type=submit] { margin-top: 0; }

.request { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-left: 3px solid var(--seam); background: var(--hull-deep); }
.request-done { border-color: var(--venom); }
.request-failed { border-color: var(--blood); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--seam); border-top-color: var(--crimson); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Bag */
.bag { margin-bottom: 16px; }
.bag-tabs { display: flex; gap: 2px; padding: 0 8px; align-items: flex-end; }
.tab { padding: 8px 16px 6px; font: 600 1.2rem var(--display); color: var(--haze); background: none; cursor: pointer; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; margin-top: 6px; }
.tab[aria-selected=true] { color: var(--bone); background: var(--hull); border-color: #5a1d1f; margin-bottom: -1px; }
.tab small { font: 400 .8rem var(--text); color: var(--haze); }
.bag:not(.js) .bag-tabs .tab { pointer-events: none; }
.bag.js .bag-title { display: none; }
.bag-title { font-size: 1.2rem; margin: 8px 0; flex-basis: 100%; }
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.filters[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 12px; font: 500 .9rem var(--text); color: var(--haze); background: var(--hull-deep); border: 1px solid var(--seam); border-radius: 14px; cursor: pointer; }
.chip:hover { color: var(--cloud); border-color: var(--bone-dim); }
.chip[aria-pressed=true] { color: #fff4ec; background: var(--crimson); border-color: #d1453f; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.f-search { width: auto; flex: 1 1 200px; margin: 0; }
.filter-row select { margin: 0; }
.f-check { margin: 0; display: flex; align-items: center; gap: 6px; }
.f-check input { width: auto; margin: 0; display: inline; }
.bag-grid { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px; background: #0f1a28; border: 1px solid #0a1220; border-radius: 3px; box-shadow: 0 0 0 1px var(--seam); }
.bag-grid[hidden] { display: none; }
.bag-grid > .hint { flex-basis: 100%; margin: 6px 2px; }

.enchant { color: #9fd8ff; }
.augment { color: #e6a0ff; }
.el-fire { color: #ff7a5c; } .el-water { color: #5cb8ff; } .el-wind { color: #9be38a; }
.el-earth { color: #d9b56a; } .el-holy { color: #fff1b0; } .el-dark { color: #b48cff; }
.grade { font: 700 .7rem var(--text); padding: 1px 5px; border-radius: 2px; background: #1b2c40; color: var(--haze); vertical-align: 2px; }
.grade.g-d { color: #a9c6e6; } .grade.g-c { color: #8fd29f; } .grade.g-b { color: #7fc0ff; }
.grade.g-a { color: #f0d070; } .grade.g-s, .grade.g-s80, .grade.g-s84 { color: #ff9a90; }

/* Tables: rankings and GM tools */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.ranking { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ranking th { text-align: left; font: 500 .85rem var(--text); color: var(--haze); padding: 4px 6px; border-bottom: 1px solid var(--seam); }
.ranking td { padding: 7px 6px; border-bottom: 1px solid rgba(52, 80, 110, .5); vertical-align: top; }
.ranking small { color: var(--haze); }
.ranking .num { text-align: right; font-variant-numeric: tabular-nums; }
.ranking .rank { color: var(--bone); width: 28px; font: 600 1.15rem var(--display); }
.table-scroll { overflow-x: auto; }
.status-done { color: var(--venom); } .status-failed { color: var(--blood); } .status-pending { color: var(--amber); }
.gm-tag { color: var(--venom); }
.search-form { display: flex; gap: 8px; margin-bottom: 14px; }
.search-form input { margin: 0; }
.search-form button[type=submit] { margin-top: 0; }

/* Upgrade pop-up and forms (character page). Levels are a dropdown with a cost line that follows the choice. */
.upgrade-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; color: var(--cloud); background: var(--hull);
	border: 1px solid #5a646f; border-radius: 4px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); overscroll-behavior: contain; }
.upgrade-dialog::backdrop { background: rgba(8, 11, 16, .72); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font: inherit; color: inherit; }
.dialog-close { width: 32px; height: 32px; font-size: 1.4rem; line-height: 1; color: var(--haze); background: none; border: 0; border-radius: 3px; cursor: pointer; }
.dialog-close:hover { color: var(--cloud); background: rgba(255, 255, 255, .06); }
.dialog-body { padding: 16px 18px 18px; overflow-y: auto; }
.dialog-body > button { margin-top: 12px; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--seam); background: var(--hull-deep); }
.notice.error { border-color: var(--blood); }
.notice.ok { border-color: var(--venom); }

.upgrade-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.upgrade-form fieldset { margin: 0; padding: 0; border: 0; }
.upgrade-form legend, .ban-form legend { margin-bottom: 8px; font-weight: 700; color: var(--bone); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.choices.routes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 0; padding: 7px 10px;
	background: var(--hull-deep); border: 1px solid var(--seam); border-radius: 3px; cursor: pointer; color: var(--cloud); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--bone-dim); }
.choice:has(input:checked) { border-color: #d1453f; background: #3a1c1e; box-shadow: 0 0 0 1px #d1453f; }
.choice:has(input:focus-visible) { outline: 2px solid var(--bone); outline-offset: 2px; }
.choice.unaffordable { opacity: .45; cursor: not-allowed; }
.choice-level { font-weight: 700; }
.choice-cost { color: var(--bone); font-variant-numeric: tabular-nums; font-size: .9rem; }
.choice-cost::after { content: " col"; color: var(--haze); font-size: .8rem; }
.pick { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.pick label { font-weight: 700; color: var(--bone); }
.pick select { min-width: 9rem; margin: 0; }
.cost-line { margin: 0; color: var(--haze); }
.augment-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--seam); }
.augment-form h3 { margin: 0 0 10px; font-size: 1rem; color: var(--bone); }
.augment-form .pick { margin-bottom: 8px; }
.augment-form .pick label { min-width: 6.5rem; }
.augment-form select { max-width: 100%; min-width: 0; flex: 1 1 14rem; }
.augment-form .cost-line { margin-top: 4px; }
.cost-line b { color: var(--cloud); font-variant-numeric: tabular-nums; }
.upgrade-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.upgrade-foot button[type=submit]:not(.link) { margin-top: 0; }
.purse-line { display: inline-flex; align-items: center; gap: 7px; color: var(--haze); }
.tip-hint { margin-top: 4px; color: var(--bone) !important; }

/* Skills tab */
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px; }
.skill-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
	padding: 6px 10px 6px 6px; color: var(--cloud); text-decoration: none; background: var(--hull-deep); border: 1px solid #2f3b48; border-radius: 3px; }
.skill-row .cell { grid-row: span 2; }
.skill-row:hover, .skill-row.chosen { border-color: var(--bone-dim); color: var(--cloud); }
.skill-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-level { grid-column: 2; color: var(--haze); font-size: .88rem; }
.skill-action { grid-column: 3; grid-row: 1 / span 2; font-size: .85rem; color: var(--bone); }
.skill-list[hidden] { display: none; }
.accounts td { white-space: nowrap; }
.economy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin-bottom: 16px; }
.big-number { margin: 0; font-size: 1.8rem; font-weight: 700; color: var(--cloud); font-variant-numeric: tabular-nums; }
.gm-credit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 10px 14px; background: var(--hull-deep); border: 1px dashed #5a646f; border-radius: 3px; }
.gm-credit .button { margin: 0; }
.gm-label { font-weight: 700; color: var(--bone); }
#credit-amount { width: 9rem; margin: 0; }
.give-search { margin: 0 0 8px; }
.give-list { list-style: none; margin: 10px 0 0; padding: 0 4px 0 0; display: grid; gap: 4px; max-height: min(52vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.give-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 5px 8px 5px 5px; background: var(--hull-deep); border: 1px solid #2f3b48; border-radius: 3px; }
.give-name { min-width: 0; }
.give-name small { display: block; color: var(--haze); }
.give-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.give-form label { margin: 0; font-size: .9rem; color: var(--haze); }
.give-form input { width: 7rem; margin: 0 0 0 4px; }
.give-form select { margin: 0 0 0 4px; }
.give-form button { margin: 0; }
.gm-remove { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #5a646f; }
.gm-remove h3 { margin: 0 0 6px; font-size: 1rem; color: var(--bone); }
.gm-remove input[type=number] { width: 7rem; margin: 0 4px; }
@media (max-width: 640px) { .give-list li { grid-template-columns: auto minmax(0, 1fr); } .give-form { grid-column: 1 / -1; } }
.shop-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px; margin-bottom: 14px; }
.shop-card { padding: 10px 14px; background: var(--hull-deep); border: 1px solid #2f3b48; border-radius: 3px; }
.shop-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--bone); }
.shop-card p { margin: 0; color: var(--haze); font-size: .92rem; }
.shop-section { margin: 6px 0 4px; font-size: 1rem; color: var(--bone); }
.look-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.look-buttons .button { margin: 0; }
.look-buttons small { color: var(--haze); font-weight: 400; }
.look-preview { margin: 0 0 12px; padding: 12px 14px; background: #0c1016; border: 1px solid #2f3b48; border-radius: 3px; text-align: center; }
.look-preview span { font-weight: 700; font-size: 1.15rem; color: #fff; }
#look-color { width: 4.5rem; height: 2.4rem; padding: 2px; margin: 0; }
#look-name { width: 14rem; margin: 0; }
.shop-grade { margin: 8px 0; }
.shop-grade summary { cursor: pointer; padding: 6px 0; font-weight: 700; color: var(--bone); }
.shop-grade summary small { color: var(--haze); font-weight: 400; }
.shop-grade .skills { margin-top: 4px; }
.bundle-pieces { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 3px 12px; font-size: .9rem; }
.bundle-pieces li { display: flex; align-items: center; gap: 7px; }
.bundle-pieces img { border: 1px solid #000; border-radius: 2px; }
.state.window { color: var(--amber); background: none; border: 0; box-shadow: none; }  /* not the .window panel */
.ban-form { margin-bottom: 12px; }
.ban-form .choices { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

@media (max-width: 1060px) {
	.char-grid.with-detail { grid-template-columns: 1fr 1fr; }
	.with-detail .status { grid-row: span 2; }
}

@media (max-width: 860px) {
	.home-body { grid-template-columns: 1fr; gap: 28px; }
	.features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nav-gap { display: none; }
	.home-aside { order: -1; }
	.page-hero-inner { grid-template-columns: 1fr; padding-top: 22px; }
	.page-hero-plate { order: -1; max-width: 490px; }
}

@media (max-width: 760px) {
	/* Too narrow for the menu to float over the art: it would cover most of it. */
	.home .top { position: static; border-bottom: 1px solid var(--seam); }
	.home .brand { visibility: visible; }
	.home .hero-art::before { display: none; }
	.char-grid, .char-grid.with-detail { grid-template-columns: 1fr; }
	.with-detail .status { grid-row: auto; }
}

@media (max-width: 520px) {
	body { font-size: 16px; }
	.cell { width: 42px; height: 42px; }
	.cell img { width: 36px; height: 36px; }
	.pd-row { gap: 4px; }
	.paperdoll { padding: 8px 4px; }
	.tip { left: auto; right: -2px; top: 48px; width: 230px; }
	.purse { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.is-up .signal { animation: none; }
	.feature img { transition: none; }
	.spinner { animation-duration: 2.4s; }
}
