.race-site .race-main { width: min(1280px, 100%); max-width: 1280px !important; margin: auto; padding: 48px 40px 80px; }
.race-site [hidden] { display: none !important; }
.race-skip { position: absolute; top: -100px; left: 16px; z-index: 10000; padding: 12px 20px; background: #d5eaf2; color: #102633; }
.race-skip:focus { top: 8px; }
.race-eyebrow { margin: 0 0 14px; color: #dec092; font-size: 14px; letter-spacing: .06em; }
.race-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: center; gap: 80px; padding-bottom: 52px; }
.race-hero h1 { margin: 0 0 24px; }
.race-hero p { max-width: 60ch; }
.race-lede { font-size: 21px; line-height: 1.65; color: #e0ebf2; }
.race-hero .race-caption { font-size: 14px; color: #b1c4d4; margin: 22px 0 0; }
.race-hero-art { position: relative; margin: 0; overflow: hidden; border-radius: 100px 100px 8px 8px; background: #14243d; }
.race-hero-art img { display: block; width: 100%; height: 410px; object-fit: cover; object-position: center 25%; }
.race-hero-art img { transform: scaleX(-1); }
.race-hero-art figcaption { position: absolute; inset: auto 0 0; padding: 40px 20px 18px; background: linear-gradient(transparent,#0b192cef); color: #d5e4eb; text-align: center; font-size: 14px; }
.race-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.race-actions > a:not(.button) { padding: 9px 0; }
#all-races { scroll-margin-top: 26px; padding-top: 30px; border-top: 1px solid #ffffff20; }
.race-gallery-heading { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin-bottom: 30px; }
.race-gallery-heading h2 { margin: 0; }
.race-gallery-heading .race-eyebrow { margin-bottom: 8px; }
.race-search { width: 300px; max-width: 100%; }
.race-search label { display: block; margin-bottom: 6px; font-size: 15px; }
.race-search > div { display: flex; gap: 8px; }
.race-search input { min-width: 0; width: 100%; padding: 11px 14px; border: 1px solid #658294; border-radius: 4px; background: #101f32; color: #edf7fa; font: inherit; }
.race-search input::placeholder { color: #a9bccb; }
.race-search button, .race-empty button { padding: 9px 12px; border: 1px solid #658294; background: #203655; color: #edf7fa; border-radius: 4px; font: inherit; cursor: pointer; }
.race-search p { margin: 4px 0 0; color: #a9bccb; font-size: 14px; }
.race-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; margin: 0; padding: 0; }
.race-card { min-width: 0; }
.race-card > a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; border: 1px solid #354a63; border-radius: 6px; background: #14243d; overflow: hidden; transition: border-color .15s, background .15s; }
.race-card > a:hover { text-decoration: none; border-color: #8cb5c8; background: #1c304b; }
.race-card-art { height: 285px; background: radial-gradient(ellipse at 50% 38%,#37516a 0%,#182b42 52%,#101e30 100%); border-bottom: 1px solid #ffffff0e; padding: 14px 12px 0; }
.race-card-art img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.race-card-copy { padding: 18px 20px 22px; }
.race-card-copy h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 27px !important; margin: 0 0 8px; }
.race-card-copy h3 span { font: 18px var(--icesus-sans); color: #88a9bd; }
.race-card-copy p { font-size: 15px; line-height: 1.65; margin: 0; color: #c0d0de; }
.race-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 60px; align-items: center; margin-top: 64px; padding: 38px 0 0; border-top: 1px solid #ffffff20; }
.race-next h2 { margin: 0 0 14px; }
.race-next p { max-width: 68ch; }
.race-next .race-actions { flex-direction: column; align-items: flex-start; gap: 8px; margin: 0; }
.race-breadcrumb { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; font-size: 14px; color: #b1c4d4; }
.race-detail-heading { max-width: 780px; margin-bottom: 36px; }
.race-detail-heading h1 { margin: 0 0 18px; }
.race-detail-heading .race-lede { margin: 0; }
/* Individual artwork direction is authored in races/catalogue.json. */
.portrait-mirrored { transform: scaleX(-1); }
.race-detail-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 48px; }
.race-showcase { min-width: 0; }
.race-showcase h2 { margin: 0 0 12px; }
.race-showcase-intro { margin: 0 0 24px; color: #c0d0de; font-size: 16px; line-height: 1.65; max-width: 55ch; }
.race-portraits { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.race-portraits figure { margin: 0; min-width: 0; }
.race-character-art { position: relative; isolation: isolate; height: 340px; padding: 8px 2px; border-radius: 120px 120px 6px 6px; background: radial-gradient(ellipse at 50% 40%,#36516a80, #14283b40 58%, transparent 78%); }
.race-character-art img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.race-portraits figcaption { border-top: 1px solid #ffffff25; padding: 20px 0 0; }
.race-portraits h3 { margin: 0 0 7px; font-size: 25px !important; line-height: 1.2; overflow-wrap: anywhere; }
.race-portraits figcaption p { font-size: 16px; line-height: 1.65; margin: 0 0 16px; color: #c0d0de; }
.race-portraits figcaption .race-character-guild { color: #dec092; font-size: 15px; line-height: 1.5; margin-bottom: 16px; }
.race-portraits figcaption a { display: inline-block; padding: 6px 0; font-size: 16px; line-height: 1.5; }
.race-more-guilds { margin: 28px 0 0; font-size: 16px; }
.race-card-copy .race-card-role { color: #dec092; font-size: 15px; margin: 0 0 10px; }
.race-lore h2 { margin: 0 0 20px; }
.race-lore p { margin: 0 0 22px; }
.race-detail-actions { margin-top: 36px; border-top: 1px solid #ffffff20; padding-top: 26px; }
.race-detail-actions p { color: #b1c4d4; font-size: 15px; margin: 16px 0; }
.race-neighbours { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 24px; border-top: 1px solid #ffffff20; margin-top: 60px; padding-top: 30px; }
.race-neighbours a { padding: 6px 0; }
.race-neighbours a:last-child { text-align: right; }
.race-neighbours span { display: block; color: #a9bccb; font-size: 13px; }
.race-site .site-footer { padding: 40px 24px; text-align: center; }
.race-site .footer-copyright { max-width: 800px; margin: 24px auto 0; font-size: 13px; }
.race-site .footer-sitemap { max-width: 980px; margin: 0 auto 20px; line-height: 2.2; }
@media(max-width: 1100px) {
  .race-site .race-main { padding: 32px 28px 60px; }
  .race-hero { gap: 36px; grid-template-columns: minmax(0,1fr) 290px; }
  .race-hero-art img { height: 390px; }
  .race-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 18px; }
  .race-card-art { height: 270px; }
  .race-detail-layout { gap: 28px; }
  .race-character-art { height: 290px; }
  .race-portraits { gap: 18px; }
}
@media(max-width: 960px) {
  .race-detail-layout { grid-template-columns: 1fr; gap: 48px; }
  .race-character-art { height: 380px; }
  .race-lore { max-width: 72ch; }
}
@media(max-width: 760px) {
  .race-hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 36px; }
  .race-hero-art { border-radius: 6px; }
  .race-hero-art img { height: 270px; object-position: center 26%; }
  .race-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .race-card-art { height: 260px; }
  .race-gallery-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .race-search { width: 100%; }
  .race-next, .race-detail-layout { grid-template-columns: 1fr; gap: 30px; }
  .race-character-art { height: 340px; }
}
@media(max-width: 440px) {
  .race-site .race-main { padding: 28px 20px 48px; }
  .race-grid { grid-template-columns: 1fr; gap: 22px; }
  .race-card-art { height: 320px; }
  .race-hero-art img { height: 260px; object-position: center 18%; }
  .race-lede { font-size: 19px; }
  .race-actions { gap: 12px; }
  .race-portraits { grid-template-columns: 1fr; gap: 36px; }
  .race-character-art { height: 370px; }
  .race-neighbours { gap: 12px; font-size: 14px; }
}
@media(prefers-reduced-motion: reduce) { .race-card > a { transition: none; } }

@media (min-width: 441px) and (max-width: 560px) {
  .race-portraits { grid-template-columns: 1fr; gap: 36px; }
  .race-character-art { height: 400px; }
}

/* RPG race sheet. Numbers and teaching copy are owned by gameplay.json and scorecard.json. */
.race-section-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 24px; font-size: 1rem; }
.race-section-links a { text-decoration-color: #7998ad; text-underline-offset: 5px; }
.race-sheet { position: relative; margin: 0 0 64px; padding: 30px; border: 1px solid #9a8054; border-radius: 12px 3px; background: radial-gradient(ellipse at 10% 10%, #39536b55, transparent 45%), linear-gradient(125deg,#192b3a,#0d1b29 72%); box-shadow: inset 0 0 0 5px #0c1723, inset 0 0 0 6px #806c454d, 0 18px 50px #0003; scroll-margin-top: 24px; }
.race-sheet::before, .race-sheet::after { content: '◆'; position: absolute; color: #c2a573; font-size: 12px; pointer-events: none; }
.race-sheet::before { top: -10px; left: 24px; }
.race-sheet::after { bottom: -10px; right: 24px; }
.race-sheet-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid #b095623d; }
.race-sheet-heading .race-eyebrow { margin: 0 0 6px; font-size: .875rem; }
.race-sheet-heading h2 { margin: 0; color: #f2dfb9; }
.race-sheet-seal { font: 3rem/1 var(--icesus-display); color: #d5b578; padding: 0 10px; }
.race-sheet h3 { margin: 0 0 12px; font-size: 1.55rem; color: #f0dfbf; }
.race-sheet h4 { font-family: var(--icesus-display); font-weight: 400; color: #edf7fa; font-size: 1.125rem; line-height: 1.35; margin: 0; }
.race-sheet-top { display: grid; grid-template-columns: minmax(0,250px) minmax(0,1fr); gap: 34px; }
.race-sheet-identity { min-width: 0; }
.race-sheet-portrait { position: relative; height: 300px; margin-top: -12px; background: radial-gradient(ellipse at 50% 57%,#a0bac235,transparent 65%); }
.race-sheet-portrait::before { content: ''; position: absolute; inset: 25px 18px 8px; border: 1px solid #bd9f5c42; border-radius: 50% 50% 4px 4px; background: linear-gradient(130deg,#c8ab6220,transparent 50%); }
.race-sheet-portrait img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.race-profile-facts { margin: 18px 0 14px; }
.race-profile-facts > div { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid #ffffff14; }
.race-profile-facts dt { font-size: .9375rem; color: #c3d0d9; }
.race-profile-facts dd { margin: 0; font: 1.45rem var(--icesus-display); color: #f2dfb9; }
.race-profile-facts dd span { font-size: .875rem; }
.race-sheet .race-xp-guide { font-size: .875rem; line-height: 1.6; margin: 0; color: #b7c8d2; }
.race-sheet-guide { color: #c3d0d9; font-size: 1rem; line-height: 1.65; margin: 0 0 20px; max-width: 72ch; }
.race-stat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.race-stat { min-width: 0; display: flex; flex-direction: column; padding: 16px; border: 1px solid #8f785449; border-radius: 3px; background: linear-gradient(150deg,#2a3b49aa,#101e2dde); box-shadow: inset 0 1px #f2dfb912; }
.race-stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.race-stat-abbr { display: grid; place-items: center; width: 44px; height: 48px; flex: 0 0 auto; clip-path: polygon(0 0,100% 0,100% 72%,50% 100%,0 72%); background: linear-gradient(#9f8355,#594b36); color: #fff1d3; font: 600 .8125rem var(--icesus-sans); letter-spacing: .05em; padding-bottom: 6px; }
.race-stat-top strong { font: 2.55rem/1 var(--icesus-display); color: #f2dfb9; }
.race-stat-top strong span { font: .875rem var(--icesus-sans); color: #b5c5d0; margin-left: 3px; }
.race-stat-pips { display: grid; grid-template-columns: repeat(10,1fr); gap: 3px; height: 5px; margin: 12px 0; }
.race-stat-pips i { background: #60728366; }
.race-stat-pips .filled { background: #d7b77a; box-shadow: 0 0 4px #e8c38322; }
.race-stat p { color: #c3d0d9; font-size: .9375rem; line-height: 1.55; margin: 0 0 16px; }
.race-stat small { display: block; font-size: .8125rem; color: #b5c5d0; margin-top: auto; }
.race-stat small b { color: #dfc697; font-weight: 500; }
.race-scale-note { color: #b7c8d2; font-size: .875rem; margin: 16px 0 0; line-height: 1.6; }
.race-sheet-bottom { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 36px; margin-top: 30px; padding-top: 28px; border-top: 1px solid #b095623d; }
.race-trait-list, .race-recovery-list { list-style: none; padding: 0; margin: 0; }
.race-trait-list > li { position: relative; padding: 16px 0 16px 22px; border-bottom: 1px solid #ffffff14; }
.race-trait-list > li::before { content: '◆'; position: absolute; top: 21px; left: 0; font-size: 9px; color: #bda16c; }
.race-trait-list > li:first-child { padding-top: 4px; }
.race-trait-list > li:first-child::before { top: 9px; }
.race-trait-list > li:last-child { border-bottom: 0; }
.race-trait-list p { color: #c3d0d9; font-size: .9375rem; line-height: 1.65; margin: 7px 0 0; }
.race-ability-rank { display: inline-block; color: #cab791; font: .8125rem var(--icesus-sans); margin-left: 7px; }
.race-resistances { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.race-resistance { padding: 5px 10px; border: 1px solid #7ca39566; border-radius: 3px; background: #8bd5a510; color: #c1e6ce; font-size: .9375rem; }
.race-resistance b { margin-left: 8px; }
.race-resistance.vulnerable { color: #ffc3aa; border-color: #e89b7366; background: #e89b7310; }
.race-trait-list .race-hazard h4, .race-variable-recovery { color: #f1c095; }
.race-variable-recovery { font-size: .9375rem; line-height: 1.6; }
.race-recovery-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.race-recovery-item { min-width: 0; border-top: 1px solid #ffffff24; padding-top: 14px; }
.race-resource-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.race-resource-label h4 { font-size: 1rem; }
.race-resource-label strong { color: #edf7fa; font: 1.75rem var(--icesus-display); margin-left: auto; }
.race-resource-abbr { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 4px; border: 1px solid #ffffff30; border-radius: 4px; font-size: .6875rem; color: #fff; }
.resource-hp { background: #803b47; }.resource-ep { background: #6c592c; }.resource-sp { background: #385c80; }.resource-psp { background: #625078; }
.race-recovery-item p { color: #c3d0d9; font-size: .9375rem; line-height: 1.6; margin: 8px 0 0; }
.race-recovery-item .race-recovery-comparison { color: #dbc496; font-size: .8125rem; }
#race-guilds-title, #race-lore-title { scroll-margin-top: 24px; }
@media(max-width: 1100px) {
  .race-sheet { padding: 26px; }
  .race-sheet-top { grid-template-columns: minmax(0,200px) minmax(0,1fr); gap: 24px; }
  .race-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .race-sheet-portrait { height: 290px; }
  .race-sheet-bottom { gap: 26px; }
}
@media(max-width: 760px) {
  .race-sheet { padding: 24px; }
  .race-sheet-top { grid-template-columns: minmax(0,1fr); gap: 30px; }
  .race-sheet-identity { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 20px; align-items: center; }
  .race-sheet-portrait { height: 240px; grid-row: span 2; }
  .race-profile-facts { margin-top: 0; }
  .race-sheet-bottom { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .race-recovery { border-top: 1px solid #b095623d; padding-top: 26px; }
}
@media(max-width: 440px) {
  .race-sheet { margin-inline: -6px; padding: 22px 16px; }
  .race-sheet-identity { column-gap: 12px; }
  .race-sheet-portrait { height: 215px; grid-row: auto; }
  .race-sheet .race-xp-guide { grid-column: 1/-1; margin-top: 12px; }
  .race-sheet-heading { gap: 8px; }
  .race-sheet-seal { padding: 0; font-size: 2rem; }
  .race-stat { padding: 12px; }
  .race-stat-grid { gap: 10px; }
  .race-stat-abbr { width: 34px; height: 38px; font-size: .6875rem; }
  .race-stat-top strong { font-size: 2.15rem; }
  .race-sheet h4 { font-size: 1.0625rem; }
  .race-recovery-list { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .race-profile-facts > div { padding: 8px 0; gap: 2px; }
}
@media(max-width: 359px) {
  .race-stat-grid { grid-template-columns: minmax(0,1fr); }
  .race-stat-top { margin-bottom: 4px; }
  .race-sheet-portrait { height: 190px; }
}
