:root {
  color-scheme: light;
  --ink: #192319;
  --muted: #495747;
  --accent: #d5fa83;
  --green: #315822;
  --canvas: #f7f7ef;
  --surface: #fffef9;
  --line: #d3dac9;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  scroll-padding-top: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
a, button, label span { transition: background-color .17s ease, color .17s ease, border-color .17s ease, box-shadow .17s ease; }
:focus-visible { outline: 2px solid #517d32; outline-offset: 4px; }
p { line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: .5rem; translate: 0 -200%; z-index: 2; }
.skip:focus { translate: 0; padding: .7rem; background: var(--surface); }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.mast, .foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mast { min-height: 4.4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 850; letter-spacing: -.045em; font-size: 1.42rem; }
.brand-mark { position: relative; flex: none; width: 1.85rem; height: 1.85rem; background: var(--accent); border: 1px solid #a9ca6b; border-radius: .38rem; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; }
.brand-mark::before { inset: .39rem; border: .15rem solid var(--ink); border-radius: .15rem; }
.brand-mark::after { width: .43rem; height: .14rem; right: .3rem; bottom: .39rem; rotate: 45deg; background: var(--ink); }
.mast nav { display: flex; align-items: center; gap: clamp(.15rem, 2vw, 1rem); }
.mast nav a { padding: .65rem .58rem; border-radius: .35rem; color: var(--muted); font-weight: 700; }
.mast nav a:hover, .mast nav a[aria-current] { color: var(--green); background: #ebf2e2; }

.front-grid, .home-shelf, .hub-shelf { display: grid; gap: 1.15rem; }
.front-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); margin-top: 1.6rem; }
.home-shelf { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.hub-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-shelf, .hub-shelf { margin-block: 2rem 3.2rem; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #283d28;
  border-radius: 1rem;
  color: #f8faee;
  background: #142015 linear-gradient(90deg, #101b11 1%, #101b11df 37%, #101b1140 76%, #14251426);
  background-image: linear-gradient(90deg, #101b11 1%, #101b11df 37%, #101b1140 76%, #14251426), url("fieldcraft-hero.jpg");
  background-size: cover;
  background-position: center, 55% 55%;
}
.home-hero { min-height: 27rem; }
.hub-hero { min-height: 20rem; background-position: center, center 56%; }
.hero-copy { position: relative; padding: clamp(1.45rem, 4vw, 3rem); }
.eyebrow, .meta {
  color: var(--green);
  font: 700 .85rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.eyebrow { margin-bottom: .65rem; }
.hero .eyebrow, .hero h1 em { color: var(--accent); }
.hero h1 { font-size: clamp(2.8rem, 5.3vw, 5.2rem); font-weight: 850; line-height: .99; }
.home-hero h1 { max-width: 10ch; }
.hero h1 em { font-style: normal; }
.hero .intro { max-width: 22rem; color: #edf2e6; }
.hero :focus-visible { outline-color: var(--accent); }
.intro { max-width: 40rem; margin-top: .85rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.95rem; padding: .55rem 1rem; border: 1px solid transparent; border-radius: .5rem; background: var(--accent); color: #202c13; font-weight: 800; }
.hero .button { margin-top: 1.1rem; }
.button:hover { background: #e4ffa9; }

.workbench { min-width: 0; padding: clamp(1.15rem, 2.55vw, 1.7rem); border: 1px solid #c8d4bd; border-radius: 1rem; background: #edf3e3; box-shadow: inset 0 3px #dbebc8; }
.workbench h2 { margin-bottom: 1rem; font-size: clamp(1.75rem, 3vw, 2.3rem); }
.workbench fieldset { margin-bottom: .7rem; }
.quick-inventory { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.quick-inventory .inventory-input { width: 6rem; flex: none; margin: 0; }
.quick-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-block: .8rem; }
.quick-result div { display: grid; gap: .2rem; padding: .55rem .65rem; border-radius: .55rem; background: #fffef9; }
.quick-result div:first-child { background: #ddecce; color: #284b1c; }
.quick-result strong { font: 750 clamp(1.65rem, 3.5vw, 2.35rem)/1.05 var(--mono); }
.quick-result span { color: #43513d; font-size: .88rem; font-weight: 650; }
.workbench .button { width: 100%; background: #2d4e22; color: #faffed; }
.workbench .button:hover { background: #3f662e; }

.shelf-title, .guide h2, .reference-notes h2 { margin-bottom: .75rem; font-size: clamp(1.55rem, 3.1vw, 2.15rem); }
.card { display: flex; position: relative; isolation: isolate; overflow: hidden; align-items: center; min-height: 13rem; border: 1px solid transparent; border-radius: .85rem; }
.card:hover { box-shadow: 0 0 0 2px #627d45; }
.card-content { position: relative; z-index: 1; padding: clamp(1rem, 3vw, 1.6rem); }
.card h3 { font-size: clamp(1.48rem, 3vw, 2.05rem); }
.card .meta + h3 { margin-top: .4rem; }
.card p:not(.meta) { margin-top: .4rem; }
.text-link { display: inline-block; margin-top: .55rem; font-weight: 800; text-decoration: underline; text-underline-offset: .23em; }
.shortcut-card { background: #f6e6d2; border-color: #ead6bc; color: #30251a; }
.shortcut-card .meta, .shortcut-card .text-link { color: #714321; }
.shortcut-card .card-content { max-width: 80%; }
.key-art { position: absolute; right: clamp(.75rem, 3vw, 1.8rem); bottom: .9rem; width: clamp(3.25rem, 8vw, 6rem); aspect-ratio: 1; display: grid; place-items: center; transform: rotate(9deg); border: 1px solid #cd986a; border-radius: .65rem; background: #f8dbb8; color: #714321; box-shadow: 0 .32rem #ca9c73; font: 750 clamp(1.8rem, 4vw, 3.55rem)/1 var(--mono); }
.game-card {
  align-items: end;
  color: #fffef8;
  background-color: #203120;
  background-image: linear-gradient(90deg, #101b11ed, #101b11bb 57%, #101b114d), url("fieldcraft-hero.jpg");
  background-position: center, right 59%;
  background-size: cover;
}
.game-card .text-link { color: var(--accent); }
.beacon-card { background: #e8f0de; border-color: #cfdcc3; }
.beacon-card .card-content { max-width: 80%; }
.beacon-card .text-link { color: var(--green); }
.mini-beacon { position: absolute; right: 1rem; bottom: 1.3rem; width: clamp(3.7rem, 9vw, 7rem); display: flex; flex-direction: column-reverse; align-items: center; }
.mini-beacon i { display: block; height: .72rem; border-radius: 2px; border: 1px solid #648753; background: #8baa73; box-shadow: inset 0 2px #b0c69d; }
.mini-beacon i:nth-child(1) { width: 100%; }
.mini-beacon i:nth-child(2) { width: 78%; }
.mini-beacon i:nth-child(3) { width: 56%; }
.mini-beacon i:nth-child(4) { width: 34%; }
.mini-beacon b { width: .85rem; height: .85rem; border: 1px solid #668a42; background: #d5fa83; border-radius: 2px; }
.mini-beacon b::before { content: ""; position: absolute; left: calc(50% - .14rem); bottom: 3.73rem; width: .28rem; height: 3.5rem; background: linear-gradient(transparent, #79a046); }

.crumbs { display: flex; flex-wrap: wrap; gap: .15rem .65rem; align-items: center; margin-block: .8rem; color: var(--muted); font-size: .9rem; }
.crumbs a { display: inline-flex; align-items: center; min-height: 2rem; }
.crumbs a:hover { color: var(--green); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }
.tool-intro { position: relative; isolation: isolate; margin-block: .85rem 1.2rem; padding: clamp(1.2rem, 3.8vw, 2.7rem); border: 1px solid var(--line); border-radius: 1rem; background: #edf3e5; }
.tool-intro h1 { font-size: clamp(2.35rem, 5.5vw, 4.05rem); }
.tool-intro .intro strong { color: var(--ink); }
.shortcut-intro { background: #f7e8d7; border-color: #ead6bc; }
.shortcut-intro h1, .shortcut-intro .intro { max-width: min(43rem, 84%); }
.shortcut-intro .eyebrow { color: #714321; }
.calculator-grid, .troubleshooter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1rem; align-items: stretch; }
.troubleshooter { grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); align-items: start; }
.panel { min-width: 0; padding: clamp(1.15rem, 2.8vw, 1.75rem); border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.panel h2 { font-size: 1.55rem; margin-bottom: 1.1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend, .inventory-label { padding: 0; font-weight: 730; }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .45rem; }
.levels label { position: relative; cursor: pointer; }
.levels span { display: grid; place-items: center; min-height: 2.75rem; border: 1px solid #afbea5; border-radius: .45rem; font: 700 1.04rem var(--mono); background: #fffef9; }
.levels input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.levels input:checked + span { border-color: #33552a; background: #33552a; color: #f8ffed; }
.levels input:focus-visible + span { outline: 2px solid #517d32; outline-offset: 3px; }
.levels label:hover span { border-color: #33552a; }
.inventory-input { width: 100%; min-height: 2.75rem; margin-top: .5rem; padding: .5rem .65rem; background: #fffef9; border: 1px solid #9eaf94; border-radius: .45rem; color: var(--ink); font-family: var(--mono); }
.field-hint, .field-error { margin-top: .5rem; font-size: .9rem; color: var(--muted); }
.field-error { color: #a0281c; }
.inventory-input[aria-invalid="true"] { border-color: #a0281c; }
.reset { min-height: 2.75rem; margin-top: .5rem; padding: 0 .25rem; background: transparent; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: .25em; }
.reset:hover { color: var(--ink); }
.results { background: #eaf2df; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.stats div { display: grid; gap: .3rem; border: 1px solid #c6d6b8; background: #f8faef; border-radius: .5rem; padding: .75rem; }
.stats div:has(.accent) { background: #dbebce; }
.stats strong { font: 750 clamp(1.9rem, 5vw, 2.85rem)/1 var(--mono); }
.stats .accent { color: var(--green); }
.stats span { color: var(--muted); font-size: .88rem; font-weight: 650; }
.completion { display: grid; grid-template-columns: 1fr auto; gap: .3rem .65rem; margin-top: .85rem; color: var(--green); font-size: .9rem; font-weight: 700; }
.completion progress { grid-column: 1 / -1; width: 100%; height: .6rem; border: 0; border-radius: .35rem; background: #d0dfc4; color: #427034; accent-color: #427034; }
.completion progress::-webkit-progress-bar { border-radius: .35rem; background: #d0dfc4; }
.completion progress::-webkit-progress-value { border-radius: .35rem; background: #427034; }
.result-note { margin-block: .65rem 1rem; color: var(--green); }
.layer-heading { font-size: 1rem; letter-spacing: 0; }
.layers { margin: .45rem 0 0; padding: 0; list-style: none; }
.layers li { display: grid; grid-template-columns: auto 1fr auto; gap: .55rem; align-items: center; border-bottom: 1px solid #cbd9bf; padding-block: .35rem; font: .875rem/1.5 var(--mono); }
.layers li::after { content: ""; grid-column: 2; grid-row: 1; justify-self: center; width: min(calc(var(--layer-size, 0) * 9%), 85%); height: .52rem; border-radius: .15rem; background: repeating-linear-gradient(90deg, #7e9c62 0 .48rem, #a9bf92 .48rem .58rem); }
.layers li:last-child { border: 0; }
.layers strong { color: var(--muted); font-weight: 600; grid-column: 3; }

.section { margin-block: 2rem; }
.guide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 1.25rem 2.5rem; border-top: 1px solid var(--line); padding-top: 1.5rem; align-items: start; }
.guide p { margin-top: .6rem; color: var(--muted); }
.guide .sources { font-size: .9rem; }
.sources a, .reference-notes a, .back-link a { color: var(--green); text-decoration: underline; text-underline-offset: .18em; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
caption { text-align: left; font-weight: 750; padding-bottom: .45rem; }
th, td { padding: .5rem .35rem; border-bottom: 1px solid var(--line); text-align: left; }
thead th { color: var(--muted); }
.back-link { margin: 1.4rem 0 2.3rem; font-weight: 750; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.foot { min-height: 5rem; padding-block: .75rem; }
.foot small { color: var(--muted); line-height: 1.5; }

.symptoms details { border-top: 1px solid var(--line); }
.symptoms summary { min-height: 2.9rem; padding: .8rem .12rem; font-weight: 750; cursor: pointer; }
.symptoms summary::marker { color: var(--green); }
.symptoms summary:hover, .symptoms details[open] summary { color: var(--green); }
.symptoms details p { margin: 0 .12rem .85rem; color: var(--muted); }
.quick-check { background: #f9efe2; border-color: #ead6bc; }
.quick-check ol { margin: 0; padding-inline-start: 1.3rem; }
.quick-check li { margin-block: .55rem; padding-inline-start: .2rem; line-height: 1.55; }
.quick-check li::marker { color: #714321; font-weight: 750; }
kbd { display: inline-block; padding: .06em .35em; border: 1px solid #b3bfa6; border-bottom-width: 2px; border-radius: .23rem; background: #fffef9; color: var(--ink); font: .88em/1.3 var(--mono); }
.reference-notes { max-width: 52rem; }
.reference-notes p, .reference-notes small { color: var(--muted); }
.reference-notes ul { padding-inline-start: 1.15rem; line-height: 1.7; }

.game-library, .player-guides { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.game-tile, .guide-entry { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.game-tile img { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; }
.game-tile div, .guide-entry { padding: 1rem; }
.game-tile h3, .guide-entry h3 { font-size: 1.35rem; }
.game-tile p, .guide-entry p:last-child { margin-top: .45rem; color: var(--muted); }
.guide-entry .meta { margin-bottom: .6rem; }
.game-tile:hover, .guide-entry:hover { border-color: var(--green); }
.player-guides .card { min-height: 0; }
.player-guides .key-art { display: none; }
.player-guides .card-content { max-width: 100%; padding: 1rem; }
.player-guides .card h3 { font-size: 1.35rem; }
.collection-banner { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.collection-banner > div { padding: clamp(1.3rem, 3vw, 2.4rem); }
.collection-banner h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
.collection-banner .button { margin-top: 1rem; }
.collection-banner img { width: 100%; display: block; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.guide-body { display: grid; gap: 1rem; }
.slot-example { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin: 1.25rem 0 0; }
.slot-diagram { display: grid; grid-template-columns: repeat(2, 2rem); gap: .25rem; }
.slot-diagram span { height: 2rem; border: 1px dashed var(--line); border-radius: .25rem; }
.slot-diagram .needed { background: var(--green); border: 1px solid var(--green); }
.guide-body section { scroll-margin-top: 1rem; }
.guide-body .panel p + p, .guide-body details:first-of-type { margin-top: .65rem; }
.guide-body .panel li { margin: .6rem 0; line-height: 1.55; }
.guide-body ol, .jump-list { padding-left: 1.3rem; }
.tool-intro .intro a, .guide-body a, .jump-list a, .hub-shelf .panel h2 a { text-decoration: underline; text-underline-offset: .18em; color: var(--green); }
.guide-menu h2:not(:first-child) { margin-top: 1.6rem; }
.jump-list li { margin-block: .5rem; line-height: 1.5; }
.notice { padding: 0 .25rem; color: var(--muted); }
.featured-guides { margin-block: clamp(1.5rem, 4vw, 3.3rem) 2.5rem; }
.featured-guides h1 { margin-bottom: 1.35rem; font-size: clamp(2.4rem, 5vw, 4.2rem); }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 1100px) {
  .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.feature-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
.feature-card img { display: block; width: 100%; height: auto; aspect-ratio: 460 / 215; object-fit: cover; }
.feature-copy { flex: 1; display: flex; flex-direction: column; align-items: start; padding: clamp(1rem, 2vw, 1.5rem); }
.feature-copy h2 { margin-block: .45rem .65rem; font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
.feature-copy p:not(.meta) { color: var(--muted); margin-bottom: 1.15rem; }
.feature-copy .text-link { margin-top: auto; color: var(--green); }
.feature-card:hover, .hub-directory a:hover { border-color: var(--green); background: #f1f5e9; }
.hub-directory { display: flex; flex-wrap: wrap; gap: .6rem; }
.hub-directory a { padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); font-weight: 700; }
.catalog-search { display: grid; max-width: 34rem; gap: .35rem; margin-block: 1.25rem; }
.catalog-search label { font-weight: 700; }
.catalog-search input { width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); color: var(--ink); }
@media (max-width: 680px) {
  .featured-grid { grid-template-columns: 1fr; gap: .75rem; }
  .feature-card { display: grid; grid-template-columns: minmax(6rem, 32%) 1fr; align-items: center; }
  .feature-card img { border-radius: .3rem; width: calc(100% - .75rem); margin-left: .75rem; }
  .feature-copy { padding: .85rem; }
  .feature-copy h2 { margin-block: .3rem .4rem; font-size: 1.35rem; }
  .feature-copy p:not(.meta) { margin-bottom: .5rem; }
}
.clock-fields { display: flex; gap: 1rem; }
.clock-fields label { display: grid; gap: .25rem; }
.clock-fields input { width: 6rem; padding: .5rem; font-size: 1rem; border-radius: .4rem; border: 1px solid var(--line); }
#run-clock { margin-top: 1rem; }
#run-clock legend { margin-bottom: .5rem; }
#run-clock output { display: block; border-radius: .4rem; padding: .75rem; background: #eaf2df; font-weight: 700; }
@media (max-width: 850px) {
  .game-library, .player-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .collection-banner, .guide-layout { grid-template-columns: 1fr; }
  .collection-banner img { order: -1; }
  .guide-menu { grid-row: auto; }
}
@media (max-width: 460px) {
  .player-guides { grid-template-columns: 1fr; }
  .game-library { gap: .55rem; }
  .game-tile div { padding: .7rem; }
}

@media (max-width: 800px) {
  .shell { width: calc(100% - 2rem); }
  .front-grid { grid-template-columns: minmax(0, 1fr); margin-top: 1rem; }
  .home-hero { min-height: 20rem; }
  .hub-hero { min-height: 15rem; }
  .workbench h2 { margin-bottom: .85rem; }
  .foot { flex-wrap: wrap; gap: .65rem; }
}

@media (max-width: 610px) {
  .home-shelf, .hub-shelf, .calculator-grid, .guide, .troubleshooter { grid-template-columns: minmax(0, 1fr); }
  .home-shelf, .hub-shelf { margin-block: 1.4rem 2rem; }
  .card { min-height: 10.75rem; }
  .hero { background-position: center, 62% 54%; }
  .desktop-break { display: none; }
  .shortcut-intro h1, .shortcut-intro .intro { max-width: 100%; }
  .shortcut-intro .key-art { display: none; }
}

@media (max-width: 430px) {
  .shell { width: calc(100% - 1.5rem); }
  .mast { gap: .35rem; min-height: 3.75rem; }
  .brand { gap: .36rem; font-size: 1.07rem; }
  .brand-mark { scale: .88; }
  .mast nav a { padding: .65rem .35rem; font-size: .88rem; }
  .hero-copy { padding: 1.25rem; }
  .home-hero h1 { font-size: clamp(2.35rem, 9.7vw, 2.7rem); }
  .home-hero { min-height: 17.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
