@media screen {
  :root {
    background: #b5c6a2 url("../media/prontera.jpg") center / cover no-repeat fixed;
  }
  .intro-art { display: none; }
  .manuals {
    margin-top: clamp(14px, 3vw, 32px);
    background: linear-gradient(to bottom, transparent 10rem, #faf7eccc 24rem, #faf7ec 48rem);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 8px 40px #35382229;
  }
}
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 4px;
}
.manuals {
  width: min(100%, 1216px);
  margin-inline: auto;
  padding: 0 clamp(16px, 4vw, 48px);
}
.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(235px, 26vw, 330px);
  padding: clamp(22px, 5vw, 64px);
  border-radius: 20px;
}
.intro-art, .intro::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.intro-art { object-fit: cover; object-position: center 65%; }
.intro::after {
  content: "";
  background: linear-gradient(90deg, #fff7dfee 0%, #fff7dfd6 35%, transparent 76%);
}
.eyebrow { margin: 0 0 .65rem; font-size: .88rem; color: var(--leaf); }
.eyebrow strong { margin-inline-start: .4em; }
h1 { margin: 0; font: 500 clamp(2.35rem, 5vw, 4.45rem)/1.3 var(--display); }
p { margin: 0; color: var(--muted); line-height: 1.7; }
.intro-description { margin-top: 9px; color: var(--ink); }
.library {
  margin-top: 12px;
  padding: clamp(16px, 2.2vw, 28px);
  border: 1px solid #c5b68e;
  border-radius: 18px;
  background: #fffaedf2;
}
h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); }
#topics { scroll-margin-top: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  :root:has(#topics:target) { scroll-behavior: smooth; }
}


.physical { --accent: #843c20; --accent-line: #ebaf82; --glow: #ffe5bb; --ribbon: #ffb77e; }
.magic { --accent: #683774; --accent-line: #dcacd9; --glow: #fae1f6; --ribbon: #e7acf1; }
.full { --accent: #205856; --accent-line: #91cfc0; --glow: #dbf7e9; --ribbon: #89dfce; }
.icon-library { position: absolute; }
.tip-icon {
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}
.topic-grid a {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 58px;
  height: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: linear-gradient(115deg, var(--glow), var(--paper));
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}
.topic-grid a:hover { border-color: var(--accent); }
.topic-grid .tip-icon { width: 1.65rem; height: 1.65rem; }

.skip { position: absolute; z-index: 2; top: 1rem; left: 1rem; padding: .5rem 1rem; background: var(--paper); }
.skip:not(:focus) { transform: translateY(-200%); }
#content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  margin-block: clamp(24px, 4vw, 48px);
}
#content > section {
  --inset: clamp(14px, 3vw, 32px);
  min-width: 0;
  padding: 0 var(--inset) var(--inset);
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 3px 0 #e0decf;
  scroll-margin-top: 1rem;
}
.section-head {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 calc(-1 * var(--inset)) 1rem;
  padding: .85rem var(--inset);
  border-radius: 15px 15px 0 0;
  background: linear-gradient(105deg, var(--ribbon), var(--glow) 78%);
  border-bottom: 1px solid var(--accent-line);
  color: var(--accent);
}
.section-head span {
  flex: none;
  padding: .3em .6em;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
h3 { margin: 1.45rem 0 .5rem; font-size: 1.16rem; }
main p { max-width: 76ch; margin: .75rem 0; }
main ol, main ul { padding-inline-start: 1.55rem; color: var(--muted); line-height: 1.65; }
main li + li { margin-top: .45rem; }
main strong { color: var(--ink); }
main a { color: var(--leaf); text-underline-offset: 4px; }
code { padding: .1em .3em; border-radius: 4px; background: #e9eddd; color: #354727; font-size: .91em; overflow-wrap: anywhere; }
.table-wrap { margin: 1rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .96rem; line-height: 1.6; }
thead { background: #e9eddd; color: #354727; }
th, td { padding: .65rem .9rem; text-align: start; vertical-align: top; }
tbody th { font-weight: 650; }
tbody td { color: var(--muted); }
tbody tr + tr { border-top: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; gap: .8rem; padding: 14px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer a { color: var(--leaf); }
.back-to-topics {
  position: fixed;
  z-index: 3;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: .6rem .85rem;
  border: 1px solid #a2ae83;
  border-radius: 999px;
  background: var(--paper);
  color: var(--leaf);
  box-shadow: 0 4px 14px #32441b21;
  font-weight: 750;
  text-decoration: none;
}
.back-to-topics:not([hidden]) { display: flex; align-items: center; gap: .4rem; }
.back-to-topics:hover { border-color: var(--leaf); background: #e9eddd; }
@media (max-width: 520px) {
  :root { background-position: 79% center; }
  .intro { align-items: end; min-height: 228px; padding: 19px; border-radius: 16px; }
  .intro-art { object-position: 76% 46%; }
  .intro::after { background: linear-gradient(0deg, #faf9f2 0%, #faf9f2f2 38%, #faf9f200 96%); }
  .intro-description { max-width: 30ch; }
  .library { padding-top: 21px; }
  table { font-size: .88rem; }
  th, td { padding: .6rem .5rem; }
}

.npc-photo {
  margin: 1rem 0 1.25rem;
  padding: clamp(12px, 2.2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.npc-photo label { display: block; color: #354727; font-weight: 700; }
.npc-photo select {
  max-width: 100%;
  margin: .45rem 0 .8rem;
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1px solid #939f7d;
  border-radius: 8px;
  background: #e9eddd;
  color: var(--ink);
  font: inherit;
}
.npc-scene { display: block; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.npc-scene img { display: block; width: 100%; height: auto; }
.npc-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
:is(#npc-halo, .npc-halo) {
  fill: none;
  stroke: #ffed9e;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px #25110b) drop-shadow(0 0 2px #25110b);
}
figcaption { margin: .7rem 0 0; color: var(--muted); line-height: 1.55; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.shot-grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.guide-shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}
.guide-shot a {
  display: grid;
  place-items: center;
  flex: 1;
  padding: .35rem;
  border-radius: 8px;
  background: radial-gradient(ellipse, #e6e9da, #f2f2e9 75%);
}
.guide-shot img {
  display: block;
  max-width: 100%;
  max-height: 276px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.guide-shot figcaption { margin: .45rem .15rem .1rem; font-weight: 680; }

a[aria-haspopup="dialog"] { cursor: zoom-in; }
body:has(.guide-lightbox[open]) { overflow: hidden; }
.guide-lightbox:not([open]) { display: none; }
.guide-lightbox {
  width: max-content;
  max-width: min(70rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
}
.guide-lightbox::backdrop { background: #100b15d9; }
.guide-lightbox-panel { padding: .65rem; }
.guide-lightbox form { display: flex; justify-content: end; margin-bottom: .55rem; }
.guide-lightbox button {
  min-height: 44px;
  padding: .3rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eddd;
  color: var(--leaf);
  font: inherit;
  cursor: pointer;
}
.guide-lightbox button:hover { border-color: var(--leaf); }
.guide-lightbox figure { display: grid; justify-items: center; margin: 0; }
.guide-lightbox-media { position: relative; max-width: 100%; }
.guide-lightbox-media img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 8rem);
  width: auto;
  height: auto;
}
.guide-lightbox-media svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guide-lightbox figcaption { margin-top: .45rem; max-width: 65ch; text-align: center; }

.shot-grid.shot-carousel { grid-template-columns: minmax(0, 1fr); }
.carousel-track { display: grid; min-width: 0; }
.carousel-track .guide-shot { grid-area: 1 / 1; visibility: hidden; }
.carousel-track .active-slide { visibility: visible; }
.carousel-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .45rem;
}
.npc-photo .carousel-controls { margin-top: .65rem; }
.carousel-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: .3rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eddd;
  color: var(--leaf);
  font: inherit;
  cursor: pointer;
}
.carousel-controls button:hover,
.carousel-controls button:focus-visible { border-color: var(--leaf); }
.carousel-position { min-width: 4.7rem; text-align: center; color: var(--muted); }

main .quick-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}
.quick-steps li {
  position: relative;
  display: grid;
  gap: .25rem;
  justify-items: start;
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.quick-steps .tip-icon { color: var(--leaf); }
.quick-steps span:not(.step-no) { font-size: .88rem; }
.step-no {
  position: absolute;
  top: .55rem;
  right: .55rem;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.quick-steps a { display: inline-block; line-height: 1.5; }
main .quick-note {
  max-width: none;
  margin: .65rem 0 0;
  padding: .55rem .8rem;
  border-inline-start: 3px solid #a2ae83;
  border-radius: 4px;
  background: #edf1df;
  color: #455631;
  font-size: .94rem;
}

.tag-key { display: grid; gap: .55rem; margin-top: .7rem; }
.tag-key div { display: grid; gap: .15rem; align-content: center; padding: .65rem .8rem; border-radius: 10px; }
.tag-key strong { width: fit-content; padding: .1rem .5rem; border-radius: 4px; color: #21172a; }
.tag-key span { color: var(--ink); }
.tag-craft { background: #deeee5; }
.tag-craft strong { background: #aee3d0; }
.tag-egg { background: #ede6f2; }
.tag-egg strong { background: #dfbdff; }
.tag-seal { background: #f4ead8; }
.tag-seal strong { background: #ffe1bd; }

.tip-details { margin-top: .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.tip-details summary { padding: .6rem .8rem; color: var(--leaf); font-weight: 700; cursor: pointer; }
.tip-details summary:hover { background: #edf1df; border-radius: 9px; }
.rebirth-tier .guide-shot { margin: 0 .45rem .45rem; }
@media (min-width: 620px) {
  .rebirth-tier .guide-shot {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    align-items: center;
    gap: .85rem;
  }
}
.tip-detail-copy { padding: 0 .8rem .55rem; }

@media (min-width: 850px) {
  main section:has(> .shot-grid > :only-child) {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: .7rem;
  }
  main section:has(> .shot-grid > :only-child) > :is(.section-head, .tip-details, .quick-note) {
    grid-column: 1 / -1;
  }
  main section:has(> .shot-grid > :only-child) > .quick-steps {
    grid-template-columns: 1fr;
    margin: 0;
  }
  main section:has(> .shot-grid > :only-child) .quick-steps li {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    align-items: center;
    column-gap: .65rem;
  }
  main section:has(> .shot-grid > :only-child) .quick-steps .tip-icon { grid-row: span 2; }
  main section:has(> .shot-grid > :only-child) .quick-steps strong { padding-inline-end: 1.45rem; }
  main section:has(> .shot-grid > :only-child) .quick-steps span:last-child { grid-column: 2; }
  main section:has(> .shot-grid > :only-child) .tag-key { margin: 0; }
}

@media (max-width: 580px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-grid a { min-height: 46px; padding: .45rem .6rem; }
  .shot-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-shot img { max-height: 230px; }
  .guide-shot figcaption { font-size: .89rem; }
  .quick-steps li { padding: .55rem .45rem; }
  .quick-steps span:not(.step-no) { font-size: .8rem; }
}

.community-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}
.community-links a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--leaf);
  text-underline-offset: 3px;
}
.community-links a:hover { border-color: var(--leaf); }
