@font-face {
  font-family: "LazyDog";
  src: url("assets/lazydog.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #20150d;
  --muted: #756758;
  --brown: #2d190e;
  --brown-2: #422617;
  --cream: #fbf4e6;
  --paper: #fffaf0;
  --line: #ded1bb;
  --gold: #f4bd3d;
  --gold-dark: #a46a13;
  --green: #65c987;
  --red: #e8654b;
  --shadow: 0 14px 38px rgba(54, 32, 15, .12);
  --hard-shadow: 0 5px 0 rgba(88, 50, 21, .18);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(165, 121, 67, .07) 0 1px, transparent 1.5px) 0 0 / 18px 18px,
    #f4ecdc;
  font: 600 16px/1.55 Inter, ui-rounded, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
[data-layout-key] { transform: translate3d(var(--layout-x, 0), var(--layout-y, 0), 0); }
.layout-adjusted { position: relative; z-index: 4; transform: translate3d(var(--layout-x, 0), var(--layout-y, 0), 0) !important; }
.game-sprite, .brand-mark img, .nav-art img, .campfire img, .mobile-brand img, .stone-loader img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.app-shell { min-height: 100vh; }
.page-shell { min-height: 100vh; margin-left: 246px; }
#app { position: relative; min-height: 100vh; outline: none; }
.custom-layout-field, .custom-layout-image { position: absolute; z-index: 8; margin: 0; overflow: auto; transform: none !important; }
.custom-layout-field { padding: 22px; border: 1px solid #d8c7a7; border-radius: 18px; background: #fffdf8; color: var(--ink); box-shadow: 0 12px 30px #2d1b1126; white-space: pre-wrap; font-size: 16px; line-height: 1.55; }
.custom-layout-image { display: grid; place-items: center; overflow: hidden; }
.custom-layout-image .custom-image-link { display: block; width: 100%; height: 100%; }
.custom-layout-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.content-hyperlink { color: #8a4f00; text-decoration: underline; text-decoration-color: #f0aa29; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.content-hyperlink:hover { color: #bb3f2f; }
.configured-hyperlink:not(button):not(a) { cursor: pointer; text-decoration: underline; text-decoration-color: #f0aa29; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.content-width { width: min(1060px, calc(100% - 56px)); margin-inline: auto; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 246px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  color: #f7eedf;
  background:
    radial-gradient(circle at 85% 12%, rgba(242, 184, 57, .12), transparent 25%),
    linear-gradient(165deg, #2b190f, #160d08 72%);
  border-right: 1px solid rgba(255,255,255,.08);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 24px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 23px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.brand-mark img { width: 38px; height: 38px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.brand strong { display: block; color: var(--gold); font-family: LazyDog, sans-serif; font-size: 21px; line-height: 1; letter-spacing: .4px; }
.brand small { display: block; margin-top: 6px; color: #a99989; font-size: 9px; font-weight: 900; letter-spacing: 2px; }

.search-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  padding: 12px 13px;
  color: #dfd2c3;
  text-align: left;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  cursor: pointer;
}
.search-trigger:hover { background: rgba(255,255,255,.09); }
.search-trigger kbd { padding: 2px 5px; color: #9d8c7d; font-size: 9px; background: #170e09; border: 1px solid #4b382c; border-radius: 5px; }

.nav-label { margin: 0 10px 8px; color: #806f60; font-size: 10px; font-weight: 900; letter-spacing: 2px; }
.primary-nav {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #765528 #1b100a;
  scrollbar-width: thin;
}
.primary-nav::-webkit-scrollbar { width: 8px; }
.primary-nav::-webkit-scrollbar-track { border-radius: 999px; background: #1b100a; }
.primary-nav::-webkit-scrollbar-thumb { border: 2px solid #1b100a; border-radius: 999px; background: #765528; }
.guide-nav-list { display: grid; gap: 5px; }
.primary-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: #bfb1a3;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: 150ms ease;
}
.primary-nav a > span:last-child { min-width: 0; }
.primary-nav .nav-art { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; text-align: center; }
.primary-nav .nav-art img { width: 27px; height: 27px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.4)); transition: transform 150ms ease; }
.primary-nav a:hover .nav-art img, .primary-nav a.active .nav-art img { transform: scale(1.08); }
.primary-nav a:hover { color: #fff5e8; background: rgba(255,255,255,.05); }
.primary-nav a.active { color: #fff8eb; background: #4a321a; border-color: #604521; box-shadow: inset 3px 0 0 var(--gold); }

.sidebar-note { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 10px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-note .campfire { width: 34px; height: 34px; flex: 0 0 34px; }
.sidebar-note .campfire img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 2px; color: #88786b; font-size: 10px; }

.mobile-header { display: none; }
.mobile-brand { display: inline-flex; align-items: center; gap: 7px; }
.mobile-brand img { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }

.hero {
  position: relative;
  min-height: 470px;
  display: flex;
  align-items: center;
  margin: 0 0 34px;
  padding: 62px 54px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 40%, rgba(236, 119, 41, .17), transparent 30%),
    radial-gradient(circle at 25% -20%, rgba(244, 189, 61, .13), transparent 40%),
    linear-gradient(135deg, #3b2112, #211108 75%);
  border-radius: 0 0 32px 32px;
  box-shadow: var(--shadow), inset 0 -7px 0 rgba(244, 189, 61, .75);
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to right, black, transparent 70%); opacity: .25; }
.hero-copy { position: relative; z-index: 2; width: min(610px, 62%); }
.eyebrow, .section-title small, .simple-header small, .guide-title-row small, .reader-top small, .quick-facts small, .related-guides > small, .path-answer small, .stage-result small {
  display: block;
  margin: 0 0 10px;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
}
.hero .eyebrow { color: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
.hero h1, .simple-header h1, .guide-title-row h1, .section-title h2, .reader-top h2 {
  font-family: LazyDog, ui-rounded, sans-serif;
  font-weight: 400;
  letter-spacing: .2px;
}
.hero h1 { margin-bottom: 22px; font-size: clamp(54px, 6vw, 82px); line-height: .98; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero-lead { max-width: 530px; margin-bottom: 28px; color: #d9ccbd; font-size: 18px; }
.hero-art { position: absolute; right: 10px; bottom: -18px; z-index: 1; width: min(45%, 450px); max-height: 92%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 10px rgba(0,0,0,.32)); }

.button-row { display: flex; flex-wrap: wrap; gap: 11px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 900;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.04); }
.button-primary { color: #2d1c0f; background: var(--gold); border-color: #da9d23; box-shadow: 0 4px 0 #a86b10; }
.button-ghost { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }

.continue-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -7px 0 32px;
  padding: 12px 16px;
  background: rgba(255,255,255,.65);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.continue-strip > span:nth-child(2) { flex: 1; }
.continue-strip small, .continue-strip strong { display: block; }
.continue-strip small { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; }
.continue-strip strong { margin-top: 2px; font-size: 13px; }
.continue-icon { width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center; overflow: hidden; background: #f1e5d3; border: 1px solid var(--line); border-radius: 12px; }
.continue-sprite { width: 39px; height: 39px; filter: drop-shadow(0 3px 2px rgba(50,25,10,.2)); }

#next-move { scroll-margin-top: 24px; }
.path-console { margin: 32px 0 70px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.path-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; background: #e7dbc8; border-bottom: 1px solid #d4c5ae; }
.path-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: transparent; border: 0; border-radius: 12px; font-weight: 900; cursor: pointer; }
.path-tab.active { background: var(--brown); color: #fff7e8; box-shadow: var(--hard-shadow); }
.path-sprite { width: 34px; height: 34px; filter: drop-shadow(0 2px 1px rgba(62,31,11,.25)); transition: transform 140ms ease; }
.path-tab:hover .path-sprite, .path-tab.active .path-sprite { transform: scale(1.08) translateY(-1px); }
.path-answer { min-height: 215px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 36px; padding: 32px 38px; }
.path-answer h2 { margin-bottom: 8px; font: 400 36px/1.05 LazyDog, sans-serif; }
.path-answer p { max-width: 650px; margin-bottom: 0; color: var(--muted); }

.home-scan, .field-grid-section { margin-bottom: 72px; }
.section-title { margin-bottom: 20px; }
.section-title h2 { margin-bottom: 0; font-size: 39px; line-height: 1.05; }
.section-title.row { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-title.row a, .simple-header > a, .back-link { color: #8c5810; font-weight: 900; }

.stage-scanner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 330px; overflow: hidden; background: var(--brown); border: 1px solid #4f301b; border-radius: var(--radius); box-shadow: var(--shadow), inset 0 -6px 0 var(--gold); }
.stage-scanner.compact { grid-template-columns: minmax(0, 1fr) 285px; min-height: 285px; }
.scanner-copy { z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 34px; color: white; }
.stage-scanner > img { width: 100%; height: 100%; object-fit: cover; object-position: center; border-left: 1px solid rgba(255,255,255,.12); opacity: .9; }
.stage-form { display: flex; align-items: end; gap: 10px; margin-bottom: 26px; }
.stage-form label { flex: 1; }
.stage-form label span { display: block; margin-bottom: 7px; color: #b8a89a; font-size: 11px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; }
.stage-form input { width: 100%; height: 49px; padding: 0 15px; color: white; background: rgba(255,255,255,.08); border: 1px solid #6a4b36; border-radius: 12px; outline: none; }
.stage-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244,189,61,.16); }
.stage-result { display: flex; align-items: center; gap: 14px; }
.stage-result .scene-orb { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; color: var(--gold); font: 400 25px LazyDog; background: #160b06; border: 2px solid #6e4927; border-radius: 50%; }
.stage-result small { margin-bottom: 2px; color: #a99380; }
.stage-result strong { display: block; font: 400 27px LazyDog; }
.stage-result p { margin: 3px 0 0; color: #bfae9d; font-size: 13px; }
.stage-result .profile-result-copy { min-width: 0; width: 100%; }
.profile-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.profile-stat-grid > span { min-width: 0; padding: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.profile-stat-grid small { display: block; overflow: hidden; color: #a99380; font-size: 9px; letter-spacing: .7px; text-overflow: ellipsis; white-space: nowrap; }
.profile-stat-grid b { display: block; overflow: hidden; margin-top: 4px; color: white; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.profile-history-grid details { overflow: hidden; background: rgba(15,7,4,.45); border: 1px solid #56381f; border-radius: 10px; }
.profile-history-grid summary { padding: 10px 12px; color: var(--gold); font-size: 12px; font-weight: 900; cursor: pointer; }
.profile-history-grid ol { max-height: 190px; margin: 0; padding: 0 12px 10px 34px; overflow-y: auto; }
.profile-history-grid li { padding: 5px 0; color: #d8cabe; font-size: 12px; }
.profile-history-grid li strong { display: inline; font: inherit; font-weight: 900; }
.profile-history-grid li span { float: right; color: #9c8a7a; font-size: 10px; }
.profile-no-history { padding: 0 12px 10px; }
.profile-loading { font-size: 0 !important; }
.profile-loading::after { width: 17px; height: 17px; content: ''; border: 2px solid #6e4927; border-top-color: var(--gold); border-radius: 50%; animation: profile-spin .7s linear infinite; }
@keyframes profile-spin { to { transform: rotate(360deg); } }
.progress-track { height: 7px; margin-top: 22px; overflow: hidden; background: #130905; border: 1px solid #56381f; border-radius: 999px; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ef8c30, var(--gold)); transition: width 450ms cubic-bezier(.2,.8,.2,1); }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.guide-card { position: relative; min-height: 126px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 15px; padding: 20px; overflow: hidden; background: rgba(255,250,240,.88); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 7px 20px rgba(64,39,17,.07); transition: 140ms ease; }
.guide-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.guide-card:hover { transform: translateY(-3px); border-color: #c9b899; box-shadow: var(--shadow); }
.guide-card-icon { display: grid; place-items: center; width: 54px; height: 54px; overflow: hidden; background: radial-gradient(circle at 50% 42%, white, color-mix(in srgb, var(--accent) 15%, white)); border: 1px solid color-mix(in srgb, var(--accent) 42%, white); border-radius: 15px; box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--accent) 18%, transparent); }
.guide-card-sprite { width: 51px; height: 51px; filter: drop-shadow(0 4px 2px rgba(52,30,13,.18)); transition: transform 140ms ease; }
.guide-card:hover .guide-card-sprite { transform: scale(1.07) rotate(-2deg); }
.guide-card-copy { min-width: 0; }
.guide-card-copy small, .guide-card-copy strong, .guide-card-copy span { display: block; }
.guide-card-copy small { margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.guide-card-copy strong { font-size: 17px; }
.guide-card-copy span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.guide-card-arrow { color: #9d7a4a; font-size: 20px; }

.simple-header { padding: 62px 0 36px; }
.simple-header > a { display: inline-block; margin-bottom: 34px; }
.simple-header h1 { margin: 0; font-size: clamp(48px, 6vw, 72px); line-height: 1; }
.library-page, .progression-page { padding-bottom: 72px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { flex: 0 0 auto; padding: 9px 15px; color: var(--muted); background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 900; cursor: pointer; }
.filter-chip.active { color: white; background: var(--brown); border-color: var(--brown); }
.library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.library-grid .guide-card { grid-template-columns: 50px minmax(0,1fr) auto; }

.progression-page .stage-scanner { margin-bottom: 28px; }
.scene-rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 30px; }
.scene-rail article { padding: 15px 13px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 13px; }
.scene-rail article > span { display: block; margin-bottom: 13px; color: #ae9d88; font-size: 10px; }
.scene-rail small, .scene-rail strong { display: block; }
.scene-rail small { color: var(--gold-dark); font-size: 10px; }
.scene-rail strong { font-size: 12px; }
.scene-rail article.active { color: white; background: var(--brown); border-color: var(--gold); box-shadow: inset 0 -4px 0 var(--gold); }
.scene-rail article.active small { color: var(--gold); }
.breakpoint-link { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.breakpoint-link > span { width: 48px; height: 48px; display: grid; flex: 0 0 48px; place-items: center; overflow: hidden; background: #f0e5d3; border: 1px solid var(--line); border-radius: 13px; }
.link-sprite { width: 46px; height: 46px; filter: drop-shadow(0 3px 2px rgba(52,30,13,.2)); }
.breakpoint-link > div { flex: 1; }
.breakpoint-link small, .breakpoint-link strong { display: block; }
.breakpoint-link small { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; }

.guide-page { min-height: 100vh; padding-bottom: 70px; }
.guide-header { padding: 42px 0 24px; }
.back-link { display: inline-block; margin-bottom: 25px; }
.guide-title-row { display: flex; align-items: center; gap: 20px; }
.guide-icon-large { display: grid; place-items: center; flex: 0 0 auto; width: 82px; height: 82px; overflow: hidden; background: radial-gradient(circle at 50% 40%, white, color-mix(in srgb, var(--guide-accent) 18%, white)); border: 1px solid color-mix(in srgb, var(--guide-accent) 50%, white); border-radius: 22px; box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--guide-accent) 28%, transparent), 0 8px 20px rgba(60,35,15,.09); }
.guide-title-sprite { width: 78px; height: 78px; filter: drop-shadow(0 5px 3px rgba(52,30,13,.2)); }
.guide-title-row small { margin-bottom: 1px; color: var(--gold-dark); }
.guide-title-row h1 { margin: 0; font-size: 55px; line-height: 1; }
.guide-title-row p { max-width: 680px; margin: 7px 0 0; color: var(--muted); }
.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 26px; }
.quick-facts div { padding: 13px 15px; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 13px; }
.quick-facts small { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.quick-facts strong { display: block; font-size: 14px; }

.guide-reader { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 18px; }
.section-tabs { position: sticky; top: 20px; display: grid; gap: 5px; }
.section-tabs a { display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 8px; padding: 9px 10px; color: var(--muted); font-size: 12px; border: 1px solid transparent; border-radius: 11px; }
.section-tabs a span { display: grid; place-items: center; width: 26px; height: 26px; font-size: 10px; background: #e4d8c5; border-radius: 8px; }
.section-tabs a.active { color: var(--ink); font-weight: 900; background: var(--paper); border-color: var(--line); box-shadow: 0 5px 15px rgba(60,35,15,.06); }
.section-tabs a.active span { color: #21150c; background: var(--guide-accent); }

.reader-card { min-height: 520px; padding: 34px 38px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.reader-top { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.reader-top small { margin-bottom: 5px; color: color-mix(in srgb, var(--guide-accent) 72%, #633c16); }
.reader-top h2 { margin: 0; font-size: 40px; line-height: 1.05; }
.reader-top > span { flex: 0 0 auto; padding: 6px 10px; color: var(--muted); background: #eee4d4; border-radius: 999px; font-size: 11px; font-weight: 900; }
.article-body { max-width: 740px; padding: 25px 0 20px; color: #4c4035; font-size: 16px; }
.article-body p { margin-bottom: 15px; }
.article-body strong { color: var(--ink); }
.article-body ul, .article-body ol { margin: 5px 0 18px; padding-left: 21px; }
.article-body li { margin: 7px 0; padding-left: 4px; }
.article-body li::marker { color: color-mix(in srgb, var(--guide-accent) 78%, #6b451c); font-weight: 900; }
.table-wrap { margin: 2px 0 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eadfce; }
th { color: #6e5d4c; background: #eee3d1; font-size: 10px; letter-spacing: .6px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td:not(:first-child), th:not(:first-child) { text-align: right; }
.field-callout { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 11px; margin: 4px 0 25px; padding: 14px 16px; color: #4b3415; background: color-mix(in srgb, var(--guide-accent) 16%, #fff8e7); border: 1px solid color-mix(in srgb, var(--guide-accent) 38%, #decdae); border-radius: 13px; }
.field-callout span { display: grid; place-items: center; width: 29px; height: 29px; background: var(--guide-accent); border-radius: 9px; font-weight: 900; }
.field-callout strong { font-size: 13px; }
.reader-controls { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: auto; border-top: 1px solid var(--line); }
.reader-controls > div { display: flex; align-items: center; gap: 10px; }
.reader-controls > .reader-button:last-child { justify-self: end; }
.reader-button, .chart-button { padding: 9px 12px; font-weight: 900; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.reader-button:hover, .chart-button:hover { background: #eee3d1; }
.reader-button.primary { color: #26190e; background: var(--guide-accent); }
.page-count { color: var(--muted); font-size: 10px; font-weight: 900; }

.related-guides { margin-top: 28px; }
.related-guides > small { color: var(--muted); }
.related-guides > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.related-guides .guide-card { min-height: 104px; }

.chart-overlay, .search-dialog { position: fixed; inset: 0; z-index: 100; }
.chart-backdrop, .dialog-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(19,11,7,.72); border: 0; backdrop-filter: blur(3px); }
.chart-drawer { position: absolute; inset: 24px 24px 24px auto; width: min(620px, calc(100% - 48px)); overflow: auto; background: var(--cream); border: 1px solid #e2d5bf; border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.chart-drawer header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; background: rgba(251,244,230,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.chart-drawer header small, .chart-drawer header h2 { display: block; margin: 0; }
.chart-drawer header small { color: var(--muted); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.chart-drawer header h2 { font: 400 34px LazyDog; }
.chart-drawer header button { width: 38px; height: 38px; background: #e7dccb; border: 0; border-radius: 11px; font-size: 22px; cursor: pointer; }
.chart-gallery { display: grid; gap: 15px; padding: 18px; }
.chart-gallery a { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 14px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.chart-gallery img { width: 110px; height: 85px; object-fit: contain; background: #20150d; border-radius: 9px; }
.chart-gallery strong, .chart-gallery span { font-size: 12px; }
.chart-gallery span { color: var(--muted); }

.search-panel { position: relative; width: min(650px, calc(100% - 30px)); max-height: min(720px, calc(100% - 80px)); margin: 44px auto; overflow: hidden; background: var(--cream); border: 1px solid #eadcc5; border-radius: 20px; box-shadow: 0 25px 80px rgba(0,0,0,.32); }
.search-input-wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.search-input-wrap > span { font-size: 24px; }
.search-input-wrap input { height: 44px; background: transparent; border: 0; outline: none; font-size: 17px; }
.search-input-wrap button { padding: 6px 9px; color: var(--muted); background: #e7dccb; border: 0; border-radius: 8px; font-size: 10px; cursor: pointer; }
.search-results { max-height: 570px; padding: 10px; overflow-y: auto; }
.search-hint { margin: 12px; color: var(--muted); font-size: 12px; }
.search-result { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; }
.search-result:hover { background: #eadfce; }
.search-result-icon { display: grid; place-items: center; width: 40px; height: 40px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.search-result-sprite { width: 38px; height: 38px; filter: drop-shadow(0 2px 1px rgba(52,30,13,.15)); }
.search-result strong, .search-result small { display: block; }
.search-result small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; padding: 11px 15px; color: white; background: #20150d; border: 1px solid #5a4230; border-radius: 11px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: 160ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.loading-state, .empty-state { min-height: 75vh; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.stone-loader, .empty-state > span { width: 76px; height: 76px; display: grid; place-items: center; }
.stone-loader img, .empty-sprite img { width: 72px; height: 72px; filter: drop-shadow(0 7px 4px rgba(52,30,13,.2)); }
.empty-state h2 { margin: 12px 0 5px; font: 400 40px LazyDog; }
.empty-state p { color: var(--muted); }

@media (max-width: 1040px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .scene-rail { grid-template-columns: repeat(3, 1fr); }
  .related-guides > div { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .page-shell { margin-left: 0; padding-top: 58px; }
  .sidebar { width: min(280px, 86vw); transform: translateX(-102%); box-shadow: 18px 0 45px rgba(0,0,0,.28); transition: transform 170ms ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 40; height: 58px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 0 9px; color: white; background: #21130b; border-bottom: 2px solid var(--gold); }
  .mobile-brand { justify-self: center; color: var(--gold); font: 400 19px LazyDog; }
  .icon-button { width: 40px; height: 40px; color: white; background: transparent; border: 0; font-size: 20px; cursor: pointer; }
  .content-width { width: min(100% - 28px, 720px); }
  .hero { min-height: 520px; padding: 42px 28px 260px; border-radius: 0 0 24px 24px; }
  .hero-copy { width: 100%; }
  .hero h1 { font-size: clamp(48px, 14vw, 68px); }
  .hero-art { right: 0; left: 0; bottom: -30px; width: min(390px, 82%); max-height: 58%; margin: auto; }
  .path-tabs { grid-template-columns: repeat(2, 1fr); }
  .path-answer { grid-template-columns: 1fr; gap: 22px; padding: 25px; }
  .path-answer .button { justify-self: start; }
  .stage-scanner, .stage-scanner.compact { grid-template-columns: 1fr; }
  .stage-scanner > img { display: none; }
  .guide-reader { grid-template-columns: 1fr; }
  .section-tabs { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .section-tabs a { flex: 0 0 auto; max-width: 220px; }
  .library-grid, .guide-grid { grid-template-columns: 1fr; }
  .guide-title-row h1 { font-size: 46px; }
  .quick-facts { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .content-width { width: calc(100% - 22px); }
  .hero { min-height: 500px; margin-bottom: 23px; padding: 34px 21px 245px; }
  .hero h1 { margin-bottom: 15px; font-size: 49px; }
  .hero-lead { font-size: 15px; }
  .button { min-height: 44px; padding-inline: 14px; font-size: 13px; }
  .path-console { margin: 22px 0 50px; }
  .path-tab { min-height: 45px; font-size: 12px; }
  .path-answer { min-height: 0; padding: 22px; }
  .path-answer h2 { font-size: 31px; }
  .home-scan, .field-grid-section { margin-bottom: 52px; }
  .section-title h2 { font-size: 33px; }
  .stage-scanner { min-height: 0; }
  .scanner-copy { padding: 22px; }
  .stage-form { align-items: stretch; flex-direction: column; }
  .stage-form button { width: 100%; }
  .stage-result { align-items: flex-start; }
  .stage-result p { line-height: 1.4; }
  .profile-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-history-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 108px; grid-template-columns: 44px 1fr auto; padding: 15px; }
  .guide-card-icon { width: 43px; height: 43px; }
  .guide-card-sprite { width: 41px; height: 41px; }
  .guide-card-copy span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .simple-header { padding: 40px 0 27px; }
  .simple-header > a { margin-bottom: 26px; }
  .simple-header h1 { font-size: 45px; }
  .scene-rail { grid-template-columns: repeat(2, 1fr); }
  .guide-header { padding-top: 24px; }
  .guide-title-row { align-items: flex-start; gap: 14px; }
  .guide-icon-large { width: 59px; height: 59px; border-radius: 17px; }
  .guide-title-sprite { width: 56px; height: 56px; }
  .guide-title-row h1 { font-size: 37px; }
  .guide-title-row p { font-size: 13px; line-height: 1.4; }
  .quick-facts { grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 18px; }
  .quick-facts div { padding: 10px 8px; }
  .quick-facts strong { font-size: 11px; line-height: 1.25; }
  .quick-facts small { font-size: 7px; letter-spacing: .6px; }
  .reader-card { min-height: 0; padding: 24px 20px 0; }
  .reader-top h2 { font-size: 32px; }
  .reader-top > span { display: none; }
  .article-body { padding-top: 20px; font-size: 14px; }
  .reader-controls { grid-template-columns: 1fr auto; padding: 11px 0; }
  .reader-controls > span:first-child { display: none; }
  .reader-controls > div { grid-column: 1; grid-row: 1; }
  .reader-controls > .reader-button:last-child { grid-column: 2; grid-row: 1; }
  .page-count { display: none; }
  .chart-drawer { inset: 12px; width: auto; }
  .chart-gallery a { grid-template-columns: 86px 1fr; }
  .chart-gallery img { width: 86px; height: 72px; }
  .chart-gallery a > span { display: none; }
  .search-panel { margin-top: 15px; max-height: calc(100% - 30px); }
}

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