@font-face {
  font-family: Fira Code;
  src: url('../assets/fonts/FiraCode-VF.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: Georgia, 'Times New Roman', serif;
  color: #28372e;
  background: #e9e7da;
  --muted: #677063;
  --line: #c9ccbb;
  --accent: #a04d30;
  --mono: 'Fira Code', monospace;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, canvas:focus-visible { outline: 2px solid #dca766; outline-offset: 4px; }
[hidden] { display: none !important; }
.bestiary { max-width: 1600px; min-height: 100svh; margin: auto; padding: 22px 26px 12px; display: flex; flex-direction: column; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 0 19px; }
.eyebrow { font: 10px/1.5 var(--mono); letter-spacing: .13em; text-transform: uppercase; margin: 0; }
h1 { margin: 5px 0 0; font-size: clamp(36px, 4.5vw, 62px); line-height: 1; font-weight: 400; letter-spacing: -.055em; }
h1 span { color: var(--accent); }
.edition { text-align: right; margin: 0; font-size: 13px; font-style: italic; line-height: 1.6; }
.edition span { color: var(--muted); }
.study { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr) 286px; grid-template-areas: 'habitat specimen'; border: 1px solid #89937e; flex: 1; min-height: 510px; }
.habitat { grid-area: habitat; min-width: 0; position: relative; overflow: hidden; background: #243e37; color: #f3f0d9; min-height: 510px; }
#viewport { position: absolute; inset: 0; }
#swamp { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#swamp:active { cursor: grabbing; }
.scene-error { max-width: 34em; margin: 32px auto; padding: 20px; color: #f3f0d9; font: 14px/1.6 var(--mono); }
noscript { grid-column: 1 / -1; }
.no-script { margin: 0; padding: 10px 12px; border-top: 1px solid #89937e; background: #e8e5d7; color: #28372e; font-size: 12px; text-align: center; }
.specimen { grid-area: specimen; min-width: 0; padding: 20px; overflow-y: auto; border-left: 1px solid #89937e; background: #f0eee2; }
.sheet-header { padding-bottom: 14px; border-bottom: 3px double var(--accent); }
h2 { margin: 0 0 13px; font-size: 31px; font-weight: 400; line-height: 1; letter-spacing: -.035em; }
.primary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.primary-stats > div { padding: 8px 9px 7px; border: 1px solid var(--line); background: #e8e5d7; }
.primary-stats dt { color: var(--muted); font: 8px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.primary-stats dd { margin: 3px 0 0; color: var(--accent); font: 18px/1 var(--mono); }
h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font: 9px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
h3::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.rules-section { margin-top: 15px; }
.rules-section + .rules-section { padding-top: 14px; border-top: 1px solid var(--line); }
.rule-entry + .rule-entry { margin-top: 11px; }
.rule-entry h4 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 5px; font-size: 15px; font-weight: 600; line-height: 1.2; }
.rule-entry h4 span { color: var(--accent); font: 10px/1.6 var(--mono); }
.rule-entry p { margin: 0; font-size: 12px; line-height: 1.48; }
.attack-entry { padding: 9px 10px; border: 1px solid var(--line); background: #e9e6d9; }
.attack-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin: 0; }
.attack-stats > div { display: flex; justify-content: space-between; gap: 7px; padding: 4px 0; border-top: 1px solid #ced0c1; }
.attack-stats .attack-roll { grid-column: 1 / -1; }
.attack-stats dt { color: var(--muted); font: 8px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.attack-stats dd { margin: 0; font: 9px/1.35 var(--mono); text-align: right; }
.condition-entry { padding-left: 10px; border-left: 2px solid var(--accent); }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding-top: 11px; color: var(--muted); font: 8px/1.5 var(--mono); }
.page-footer a { color: inherit; text-decoration: none; }
.page-footer a:hover { color: var(--accent); }
@media (min-width: 761px) and (min-height: 650px) {
  .bestiary { height: 100svh; }
  .study { min-height: 0; }
  .habitat { min-height: 0; }
  .specimen { scrollbar-width: thin; scrollbar-color: #b2b6a3 transparent; }
}
@media (max-width: 1000px) {
  .bestiary { padding: 18px 18px 10px; }
  .study { grid-template-columns: minmax(0, 1fr) 255px; }
  .specimen { padding: 19px; }
}
@media (max-width: 760px) {
  .bestiary { padding: 16px 12px 12px; }
  .heading { padding-bottom: 17px; gap: 10px; }
  .heading .eyebrow { font-size: 8px; }
  .edition { font-size: 11px; }
  .study { display: flex; flex-direction: column; }
  .habitat { min-height: 430px; height: 66svh; max-height: 640px; }
  .specimen { border-left: 0; border-top: 1px solid #89937e; padding: 23px; }
  .page-footer { font-size: 7px; }
}
@media (max-width: 360px) {
  .edition { display: none; }
}


html.embedded .bestiary { min-height: 100svh; padding: 0; }
html.embedded .heading,
html.embedded .page-footer { display: none; }
html.embedded .study { min-height: 0; border: 0; }
html.embedded .habitat {
  flex: none;
  height: min(100svh, 520px);
  min-height: min(100svh, 360px);
  max-height: 520px;
}
@media (min-width: 761px) {
  html.embedded .bestiary { height: 100svh; }
  html.embedded .habitat { height: auto; min-height: 0; max-height: none; }
}

