.cx-chapter {
  --cx-sky: #add2eb;
  --cx-brass: #e6c89c;
  --cx-fade: radial-gradient(ellipse at center,#1f405636,transparent 68%);
  min-width: 0;
}
.cx-chapter .chapter-heading { max-width: 53rem; }
.cx-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem 1rem;
  margin: 2rem auto clamp(2.4rem,7vw,5.5rem);
}
.cx-jump label, .cx-related {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  color: #b9d3e7;
}
.cx-jump label { font-size: .9rem; }
.cx-jump .icon, .cx-related .icon { width: 16px; height: 16px; }
.cx-jump select, .cx-instrument select, .cx-instrument input {
  max-width: 100%;
  min-height: 42px;
  border: 1px solid #476279;
  border-radius: 3px;
  color: #e1edf4;
  background: #0d1a29;
  padding: .35em .7em;
  font: inherit;
}
.cx-jump select { width: min(25rem,100%); }
.cx-entry {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr);
  align-items: center;
  column-gap: clamp(1.35rem,3vw,3rem);
  padding: clamp(2.6rem,5vw,5rem) clamp(.7rem,2vw,2.4rem);
  scroll-margin-top: 12px;
}
.cx-entry + .cx-entry::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  top: 0;
  left: 50%;
  border: 1px solid #668296;
  background: #17293a;
  transform: rotate(45deg);
}
.cx-reading { min-width: 0; position: relative; z-index: 1; }
.cx-reading h3 {
  color: #f1ece3;
  font-size: clamp(28px,3vw,47px);
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.cx-prose p { margin: .9rem 0 0; line-height: 1.55; color: #c3d3e1; text-wrap: pretty; }
.cx-related {
  margin: 1rem 0 0;
  padding: .22rem 0;
  font-size: .94rem;
  text-decoration: underline;
  text-decoration-color: #527895;
  text-underline-offset: .24em;
}
.cx-related:hover { color: #f0d6ab; }
.cx-facts { margin: 1.25rem 0; display: flex; gap: 14px; }
.cx-facts dt { color: #99b6ca; font-size:.8rem; }
.cx-facts dd { margin:0; color:var(--cx-brass); font: 1.15rem/1.35 var(--serif); }
.cx-gallery { min-width: 0; margin: 0; text-align: center; }
.cx-stage {
  --cx-height:390px;
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(160px,17vw,245px);
  gap: 8px;
}
.cx-stage::before { content: ""; position:absolute; z-index:-1; inset:-8% -2%; background: var(--cx-fade); pointer-events:none; }
.cx-screen {
  position:relative;
  width:min(100%,var(--cx-width),calc(var(--cx-height) * var(--cx-ratio)));
  aspect-ratio:var(--cx-ratio);
  max-width:100%;
}
.cx-object, .cx-reference img {
  display: block;
  margin: auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: var(--cx-height);
  aspect-ratio: var(--cx-ratio);
  object-fit: contain;
}
.cx-workshop .cx-stage { --cx-height:410px; }
.cx-armour .cx-stage,.cx-weapons .cx-stage { --cx-height:320px; }
.cx-jewels .cx-stage { --cx-height:240px; }
.cx-journey .cx-stage { --cx-height:330px; }
.cx-village .cx-object { filter: drop-shadow(0 4px 16px #01060d91); }
.cx-armour .cx-object,.cx-weapons .cx-object,.cx-reference img {
  max-height: 320px;
  mask-image: linear-gradient(90deg,transparent,#000 10%,#000 88%,transparent),linear-gradient(0deg,transparent,#000 12%,#000 91%,transparent);
  mask-composite: intersect;
}
.cx-jewels .cx-object {
  max-height: 240px;
  mask-image: linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent),linear-gradient(0deg,transparent,#000 14%,#000 85%,transparent);
  mask-composite: intersect;
}
.cx-tools { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:4px 13px; margin:.55rem 0 .15rem; }
.cx-tools button {
  display:inline-flex; gap:.4em; justify-content:center; align-items:center;
  min-height:32px; padding:.15em .4em; color:#a8c8df; font-size:.83rem;
}
.cx-tools button .icon { width:15px; height:15px; }
.cx-tools button:hover,.cx-tools button[aria-pressed=true] { color:#f1d9ae; }
.cx-caption { color:#adbdca; font-size:.88rem; line-height:1.32; text-wrap:balance; }
.cx-choices { margin: .8rem auto 0; display:flex; justify-content:center; align-items:stretch; flex-wrap:wrap; gap: 3px 8px; max-width: 42rem; }
.cx-choice {
  position:relative; display:flex; gap:4px; align-items:center; justify-content:center;
  max-width:100%; min-height:34px; border-bottom:1px solid transparent; padding:.25rem .28rem;
  color:#b4c9d9; font-size:.85rem; line-height:1.27; text-wrap:balance;
}
.cx-choice.has-thumb { flex-direction:column; }
.cx-choice img { width: 47px; height: 35px; object-fit: contain; border-radius: 16%; }
.cx-choice[aria-pressed=true] { color:#f0d8b0; border-color:#ab8b61; }
.cx-choice:hover { color:white; }
.cx-comparing .cx-screen { max-width:calc(50% - 4px); }
.cx-compare-title { display:none; }
.cx-comparing .cx-compare-title {
  display:block; padding:.25rem 0; font-size:.88rem; color:var(--cx-sky); text-align:center;
}
.cx-journey { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); }
.cx-journey .cx-stage { min-height: 175px; }
.cx-journey .cx-object {
  max-height:330px;
  mask-image: linear-gradient(90deg,transparent,#000 7%,#000 91%,transparent),linear-gradient(0deg,transparent,#000 13%,#000 85%,transparent);
  mask-composite: intersect;
}
.cx-route-point { display:block; width:11px;height:11px;margin:0 0 18px 3px; border:1px solid #a0c8e2; background:#294359; transform:rotate(45deg); box-shadow:0 0 0 3px #0e1b29,0 0 0 4px #39566a; }
.cx-workshop .cx-hot,.cx-workshop .cx-target,.cx-village .cx-hot {
  position:absolute; top:var(--y); left:var(--x); transform:translate(-50%,-50%);
}
.cx-hot {
  display:grid;place-items:center;border-radius:50%;width:29px;height:29px;
  padding:0;line-height:1;border:1px solid #ceeaff;color:#fff5db;background:#0a2132df;
  box-shadow:0 0 0 3px #50728f5e,0 0 12px #0b141d;
}
.cx-target { height:var(--h); width:var(--w); border:1px solid #d8b77280; border-radius:4px; }
.cx-target:hover,.cx-target:focus-visible,.cx-hot:hover { background:#679ac56b; }
.cx-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.cx-instrument { margin: 1.4rem 0 0; color:#cbdde7; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .8rem; }
.cx-demo-heading { width:100%; color:#a7c8e0; font-size:.68rem; font-weight:600; text-transform:uppercase; letter-spacing:.15em; }
.cx-slot-list, .cx-gear-slots { width:100%; display:flex; flex-wrap:wrap; align-items:flex-start; gap:5px; }
.cx-slot-list button { width:30px; height:32px; padding:0; border-bottom:1px solid #36516b; font:1.03rem var(--serif); color:#b6cee1; }
.cx-instrument button[aria-pressed=true] { background:#1d36409c; color:#ffddb1; border-color:#d7b77e; }
.cx-slot-list .cx-in-use::after { content:""; display:inline-block; width:4px;height:4px;margin-left:2px;border-radius:50%;background:#93d8a0; }
.cx-gear-slots button { display:grid;justify-items:center; gap:3px; padding:4px; min-width:58px; font-size:.8rem; border-bottom:1px solid #39546a; }
.cx-gear-slots img { width:34px;height:34px;object-fit:contain; }
.cx-instrument label { display:flex; flex-wrap:wrap; gap:4px 9px; align-items:center; font-size:.9rem; }
.cx-instrument input { width:6.4rem; }
.cx-action { color:#c2dcec; min-height:36px; padding:5px 9px; border-bottom:1px solid #678699; font-size:.95rem; }
.cx-balance { width:100%; font-size:1.08rem; color:var(--cx-brass); }
.cx-casting {
  width: min(100%,278px); aspect-ratio:278/226; position:relative; overflow:hidden; border-radius:5px;
  container-type:inline-size;
  background:url("./atlante/pesca-acqua.webp") no-repeat center/100% 100%;
}
.cx-target-ring { position:absolute; left:31%;top:26%;width:38%;height:47%; }
.cx-casting button {
  position:absolute; top:50%; left:50%; width:36px;height:36px;padding:0;
  transform:translate(-50%,-50%); animation:cx-swim 3.3s ease-in-out infinite alternate;
}
.cx-casting button img { margin:auto; width:30px;height:30px; }
@keyframes cx-swim {
  from { transform:translate(calc(-50% - 38cqw),calc(-50% - 1cqw)); }
  to { transform:translate(calc(-50% + 38cqw),calc(-50% + 4cqw)); }
}
.cx-casting.cx-offscreen button { animation-play-state:paused; }
@media(prefers-reduced-motion:reduce) { .cx-casting button { left:50%;top:50%;animation:none; } }
#codex-zoom {
  width:fit-content;max-width:94vw;max-height:92dvh; padding:12px 16px; margin:auto;
  background:#0b1624; color:#dae6ef;border:1px solid #637e91;border-radius:6px;text-align:center;
}
#codex-zoom::backdrop { background:#030912df; }
.cx-zoom-top { display:flex;justify-content:space-between;align-items:center; gap:18px;margin-bottom:8px; font-family:var(--serif); }
.cx-zoom-top button { width:36px;height:36px; }
.cx-zoom-area { max-height:68dvh; overflow:auto; }
.cx-zoom-area img { width:auto;height:auto;max-width:min(85vw,1250px);max-height:68dvh;margin:auto; }
#codex-zoom.cx-wide .cx-zoom-area img { width:var(--cx-natural-zoom); height:auto; max-height:none;max-width:none; }
#codex-zoom p { margin:8px 0 0;color:#adc1d0;font-size:.9rem; }
#codex-zoom [data-cx-scale] { padding:6px 11px;color:#d6e6f1;text-decoration:underline;text-underline-offset:.23em; }
@media(min-width:901px) {
 .cx-entry.cx-reverse { grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr); }
 .cx-reverse .cx-reading { grid-column:2;grid-row:1; }
 .cx-reverse .cx-gallery { grid-column:1;grid-row:1; }
 .cx-jewels { padding-block:2.7rem; }
 .cx-jewels .cx-stage { min-height:146px; }
}
@media(max-width:900px) and (min-width:681px) {
 .cx-entry { column-gap:20px; padding-inline:0; }
 .cx-choice { font-size:.8rem; }
}
@media(max-width:680px) {
 .cx-entry { grid-template-columns:minmax(0,1fr); row-gap:19px;padding:42px 3px; }
 .cx-reading { max-width:35rem; margin:auto;width:100%; }
 .cx-reading h3 { font-size:29px; }
 .cx-journey .cx-route-point { float:left; margin:9px 12px 5px 2px; }
 .cx-prose p { font-size:1rem;line-height:1.45; }
 .cx-object,.cx-workshop .cx-object { max-height:310px; }
 .cx-entry .cx-stage { --cx-height:310px; }
 .cx-armour .cx-stage,.cx-weapons .cx-stage { --cx-height:258px; }
 .cx-jewels .cx-stage { --cx-height:240px; }
 .cx-gallery { max-width:100%; }
 .cx-stage { min-height:90px; }
 .cx-choices { gap:4px 7px; }
 .cx-choice,.cx-tools button { min-height:40px; }
 .cx-jump { flex-direction:column;gap:8px;margin:19px 0 20px; }
 .cx-jewels .cx-stage { min-height:85px; }
 .cx-armour .cx-object,.cx-weapons .cx-object { max-height:258px; }
 .cx-choice img { width:36px;height:30px; }
 .cx-instrument .cx-slot-list button { min-width:29px;min-height:39px; }
}
