:root {
  color-scheme: dark;
  --night: #160f25;
  --panel: #261b36;
  --panel-deep: #180f29;
  --text: #fff3f6;
  --muted: #e2d0e4;
  --dim: #c3adcf;
  --line: #543c61;
  --mint: #9af4e1;
  --rose: #ffa0c4;
  --paper: #ffdbab;
  --accent: var(--rose);
  --accent-ink: #2f1231;
  --sunset: linear-gradient(104deg, #ffcb9f, #ff9dc5 66%, #dea8ff);
  --coastline: linear-gradient(90deg, #ffbc87, #fa85b7 40%, #af98fc 74%, #83eadc);
  --shadow: 0 16px 42px #09041890;
  --body: Manrope, 'Noto Sans JP Variable', system-ui, sans-serif;
  --display: 'Barlow Condensed', 'Noto Sans JP Variable', system-ui, sans-serif;
  background: var(--night);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
body:not(.page-home) main {
  background:
    radial-gradient(ellipse at 87% 1rem, #6f315758 0, transparent 39rem),
    radial-gradient(ellipse at 2% 28rem, #41305d59, transparent 33rem),
    linear-gradient(#1b112a, var(--night) 46rem);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: .99; letter-spacing: -.024em; text-wrap: balance; }
h2 { font-size: clamp(2.07rem, 3.35vw, 3.36rem); }
h3 { font-weight: 800; font-size: 1.12rem; line-height: 1.34; text-wrap: pretty; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .23em; }
a:hover { color: var(--accent); }
a, button, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { background: var(--accent); color: var(--accent-ink); }
code { font-family: 'Cascadia Mono', 'Segoe UI Symbol', monospace; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.wrap { width: min(100% - 6vw, 1240px); margin-inline: auto; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent); }
.visually-hidden, .honey, .skip:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip:focus { position: fixed; top: .7rem; left: .7rem; z-index: 20; background: var(--mint); color: var(--accent-ink); padding: .6rem 1rem; border-radius: .5rem; }
.page-puzzle { --accent: var(--mint); --accent-ink: #12282a; }
.page-print { --accent: var(--paper); --accent-ink: #361c27; }

.masthead {
  position: relative;
  z-index: 4;
  background: linear-gradient(115deg,#171023,#21132d 48%,#26152b);
  border-bottom: 1px solid #ffabca40;
}
.masthead::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--coastline); }
.masthead-inner {
  display: grid;
  grid-template-columns: max-content minmax(0,1fr) max-content;
  align-items: center;
  min-height: 76px;
  gap: clamp(1rem, 3.4vw, 3.2rem);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--display);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .028em;
  text-transform: uppercase;
  font-size: clamp(1.34rem, 2.4vw, 1.88rem);
  line-height: .9;
  width: max-content;
}
.brand b { color: var(--rose); font-weight: inherit; }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid #ffabc6c4;
  border-radius: .32rem .74rem .32rem .32rem;
  padding: 5px;
  width: 35px;
  height: 35px;
  transform: skew(-9deg);
  background: linear-gradient(147deg,#512a57,#2d1d46 52%,#143b47);
  box-shadow: inset 0 0 12px #ffabc532, 0 0 17px #ff9bc020;
  transition: box-shadow .22s ease, transform .22s ease;
}
.brand-mark i, .field-mark i { width: 4px; background: var(--paper); height: 15px; border-radius: 2px; }
.brand-mark i:nth-child(2), .field-mark i:nth-child(2) { height: 22px; background: var(--rose); }
.brand-mark i:last-child, .field-mark i:last-child { height: 11px; background: var(--mint); }
.brand:hover .brand-mark { box-shadow: 0 0 21px #ffa0c45a; transform: skew(-9deg) translateY(-2px); }
.tabs { display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; column-gap: clamp(.85rem, 2.5vw, 2.35rem); }
.tabs a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 1.43rem 0;
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  transition: color .2s ease;
}
.tabs a::after {
  content: '';
  position: absolute;
  bottom: .1rem;
  inset-inline: 0;
  height: 3px;
  background: var(--coastline);
  transform: scaleX(0);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.tabs a:hover, .tabs a[aria-current] { color: var(--text); }
.tabs a:hover::after, .tabs a[aria-current]::after { opacity: 1; transform: scaleX(1); }
.locale-selector { position: relative; }
.locale-selector summary {
  display: flex;
  align-items: center;
  gap: .48rem;
  padding: .43rem .62rem;
  border-radius: .5rem;
  border: 1px solid #ffffff27;
  color: var(--muted);
  transition: background .2s ease, color .2s ease;
}
.locale-selector summary::after {
  content: '';
  width: .43rem;
  height: .43rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-.1rem);
  margin-left: .1rem;
}
.locale-selector[open] summary, .locale-selector summary:hover { background: #412441; color: var(--text); }
.locale-selector[open] summary::after { transform: rotate(225deg); }
.locale-list {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: min(20rem, 85vw);
  background: #2b1d3b;
  border: 1px solid #77506f;
  border-radius: .7rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: .42rem;
}
.locale-list a { padding: .42rem .58rem; border-radius: .36rem; text-decoration: none; }
.locale-list a:hover, .locale-list a[aria-current] { color: var(--mint); background: #4a2d4d; }

.icon { display: inline-block; flex: 0 0 auto; position: relative; width: 1.24em; height: 1.24em; vertical-align: middle; color: currentColor; }
.icon::before, .icon::after { content: ''; position: absolute; }
.icon--puzzle::before { inset: 12% 9%; border: .115em solid; border-top-color: transparent; border-bottom-color: transparent; transform: rotate(-15deg); border-radius: .2em; }
.icon--puzzle::after { inset: 27% 28%; background: currentColor; clip-path: polygon(53% 0,100% 34%,66% 53%,96% 66%,46% 100%,0 66%,34% 50%,3% 30%); }
.icon--safes::before { inset: 12%; border: .105em solid; border-radius: .25em; }
.icon--safes::after { inset: 35%; border: .102em solid; border-radius: 50%; }
.icon--print::before { inset: 15% 16%; border: .105em solid; border-radius: .13em; transform: skewY(-12deg); }
.icon--print::after { top: 17%; bottom: 17%; left: 47%; width: .09em; background: currentColor; transform: skewY(12deg); }
.icon--globe::before { inset: 13%; border: .10em solid; border-radius: 50%; }
.icon--globe::after { inset: 14% 34%; border: .08em solid; border-radius: 50%; }
.icon--search::before { inset: 10% 27% 27% 10%; border: .1em solid; border-radius: 50%; }
.icon--search::after { width: 41%; height: .1em; background: currentColor; bottom: 19%; right: 3%; transform: rotate(45deg); }
.icon--letter::before { inset: 19% 10%; border: .1em solid; border-radius: .1em; }
.icon--letter::after { width: 42%; height: 42%; border-bottom: .1em solid; border-right: .1em solid; top: 12%; left: 29%; transform: rotate(45deg); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .53rem;
  min-height: 44px;
  padding: .58rem .92rem;
  max-width: 100%;
  border-radius: .4rem .82rem .4rem .4rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease, background .22s ease, color .22s ease;
}
.button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 9px 23px #06091193; }
.button:not(:disabled):active { transform: translateY(1px); }
.button--primary { background: var(--accent); color: var(--accent-ink); }
.button--primary:not(:disabled):hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent), white 22%); box-shadow: 0 7px 25px color-mix(in srgb,var(--accent) 25%, transparent); }
.button--quiet { background: transparent; color: var(--muted); }
.button--quiet:hover { color: var(--text); background: #49304c; }
.button--subtle { background: #352644; color: var(--text); border-color: #664967; }
.button--subtle:hover { color: var(--accent); border-color: currentColor; }
.button--glass { background: #25172bd4; border-color: #ffd5e789; color: var(--text); backdrop-filter: blur(7px); }
.button--glass:hover { background: #4e2948; border-color: var(--rose); }
.button--sunset { background: var(--sunset); color: #28152d; box-shadow: 0 6px 21px #ff9ac236; }
.button--sunset:not(:disabled):hover { color: #28152d; box-shadow: 0 8px 26px #ffb6a45e; }
.button--paper { background: var(--paper); color: #271d22; }
.button--paper:hover { color: #271d22; background: #fff1cd; }
.button:disabled { opacity: .48; cursor: default; }
.text-link { color: var(--accent); font-weight: 700; transition: color .2s; }
.text-link:hover { color: var(--text); }

.home-cover {
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: clamp(420px, 42vw, 646px);
  display: grid;
  align-items: center;
  border-bottom: 1px solid #ffb2b84f;
  background: #352437;
}
.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  z-index: -2;
}
.home-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #180e21ef 1%, #211128ce 22%, #24122a7c 43%, #2a14361c 73%),
    linear-gradient(0deg,#190f25d0,transparent 44%);
}
.home-cover::before { position: absolute; z-index: 1; content: ''; inset: auto 0 0; height: 4px; background: var(--coastline); opacity: .8; }
.cover-copy { padding-block: 4rem 5.2rem; }
.cover-copy h1 { font-size: clamp(4.2rem, 9.35vw, 9.55rem); line-height: .79; max-width: 10ch; text-transform: uppercase; text-shadow: 0 .025em .18em #0d101d75; }
.cover-copy em { display: block; color: #ffb9c9; font-weight: 700; margin-top: .11em; }
@supports (background-clip: text) {
  .cover-copy em { background: var(--sunset); background-clip: text; color: transparent; text-shadow: none; }
}
.cover-copy p { margin-top: 1.35rem; max-width: 38rem; font-size: clamp(1rem, 1.5vw, 1.24rem); color: #f3eff8; }
.cover-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.6rem; }
.cover-actions .button { min-height: 48px; }
.home-grid { padding-block: clamp(2rem, 4vw, 3.45rem); }
.tool-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.25rem; }
.tool-card {
  --card-accent: var(--mint);
  background: linear-gradient(145deg,#2c1f3a,#22182e 60%);
  color: var(--text);
  text-decoration: none;
  border: 1px solid #ffffff29;
  border-top: 2px solid var(--card-accent);
  border-radius: .35rem 1.16rem .55rem .55rem;
  overflow: hidden;
  box-shadow: 0 11px 22px #0809152b;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.tool-card--safes { --card-accent: var(--rose); }
.tool-card--print { --card-accent: var(--paper); }
.tool-card:hover { color: var(--text); transform: translateY(-5px); box-shadow: 0 16px 32px color-mix(in srgb,var(--card-accent) 15%,#080510); border-color: var(--card-accent); }
.tool-card img { width: 100%; aspect-ratio: 1.91; object-fit: cover; transition: filter .24s ease; }
.tool-card:hover img { filter: brightness(1.14) saturate(1.12); }
.tool-card-copy { padding: 1.18rem; }
.tool-card-meta { color: var(--card-accent); display: inline-flex; gap: .46rem; align-items: center; font-weight: 800; }
.tool-card-meta .icon { transition: transform .24s ease; }
.tool-card:hover .icon { transform: rotate(-9deg) scale(1.16); }
.tool-card h3 { margin-top: .3rem; font-family: var(--display); font-size: 1.75rem; }
.tool-card p { color: var(--muted); margin-top: .48rem; }
.home-field {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0,1fr);
  gap: 1.5rem;
  border: 1px solid #ffadc569;
  border-radius: .45rem 1.26rem .45rem .45rem;
  background: linear-gradient(105deg,#41253f,#261c3a 75%);
  padding: clamp(1.1rem, 3vw, 2.2rem);
  margin-bottom: 4rem;
}
.home-field p { margin-top: .6rem; color: var(--muted); max-width: 62ch; }
.field-mark { display: flex; gap: .36rem; align-items: center; justify-content: center; min-width: 69px; height: 69px; border-radius: .35rem .85rem .35rem; border: 1px solid #ffa8cf90; transform: skew(-7deg); background: linear-gradient(155deg,#49244c,#27234a); }
.field-mark i { width: 8px; height: 29px; }
.field-mark i:nth-child(2) { height: 41px; }
.field-mark i:last-child { height: 21px; }

.page-wrap { padding-block: 1.08rem clamp(3rem, 6vw, 5.8rem); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .64rem; color: var(--dim); }
.breadcrumbs a { color: var(--muted); transition: color .2s ease; }
.breadcrumbs a:hover { color: var(--accent); }
.page-heading { padding-block: clamp(1rem, 3vw, 1.8rem) clamp(1.2rem, 3vw, 2rem); }
.page-heading h1 { font-size: clamp(2.6rem, 5.9vw, 5.45rem); font-style: italic; text-transform: uppercase; }
.page-heading::after { content: ''; display: block; width: min(32vw,9rem); height: 3px; margin-top: 1rem; background: linear-gradient(90deg,var(--accent),#bd95f7); transform: skewX(-23deg); }
.page-heading p { max-width: 78ch; color: var(--muted); margin-top: .7rem; font-size: clamp(1rem, 1.3vw, 1.17rem); }
.surface { padding: clamp(1rem, 2.3vw, 1.75rem); background: linear-gradient(148deg,#322142,var(--panel) 62%); border: 1px solid var(--line); border-top-color: color-mix(in srgb,var(--accent) 45%,var(--line)); border-radius: .48rem 1.15rem .48rem .48rem; box-shadow: 0 12px 30px #0e06185c; }
.notice { padding: .8rem 1rem; color: var(--text); border: 1px solid var(--accent); margin-bottom: 1rem; }
.stack { display: grid; gap: .38rem; min-width: 0; font-weight: 700; }
input:not([type="radio"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .48rem .6rem;
  color: var(--text);
  border: 1px solid #555c70;
  background: var(--panel-deep);
  border-radius: .38rem;
  font-weight: 500;
  transition: background .2s, border-color .2s ease;
}
:where(input, select, textarea):hover { border-color: var(--accent); }
:where(input, textarea)::placeholder { color: var(--dim); }
textarea { min-height: 130px; resize: vertical; }
input[aria-invalid="true"] { border-color: #ffab9f; }
.feedback { color: var(--accent); min-width: 0; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.input-error { color: #ffb1a8 !important; }
.badge-icon {
  display: grid;
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.2rem;
  border: 1px solid currentColor;
  color: var(--accent);
  border-radius: .65rem;
  background: color-mix(in srgb,var(--accent) 9%,transparent);
  transition: transform .22s ease, box-shadow .22s ease;
}
.badge-icon:hover { transform: rotate(-6deg) scale(1.08); box-shadow: 0 5px 16px #0b0e1b; }

.notebook { display: grid; grid-template-columns: minmax(0,1fr) minmax(275px,.48fr); align-items: start; gap: 1rem; }
.notebook-main { padding-top: .85rem; }
.notebook-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.notebook-head, .clue-row { display: grid; grid-template-columns: minmax(6.3rem,.86fr) minmax(8.7rem,1.3fr) minmax(5.2rem,1fr) 3.22rem; gap: .45rem .8rem; align-items: center; }
.notebook-head { color: var(--dim); font-weight: 700; padding-block: .45rem; }
.clue-row { padding-block: .6rem; border-top: 1px solid #503655; }
.clue-row label { min-width: 0; }
.field-caption { display: none; }
.clue-date { color: var(--text); font-weight: 750; line-height: 1.24; }
.clue-digit { min-height: 44px; display: grid; place-items: center; border: 1px solid #9af4e174; background: linear-gradient(145deg,#21414a,#26304b); border-radius: .32rem .62rem .32rem .32rem; color: var(--mint); font: 700 1.46rem/1 var(--display); }
.row-hint { grid-column: 2 / -1; line-height: 1.45; }
.symbols { display: flex; flex-wrap: wrap; gap: .35rem; }
.symbols button { min-width: 42px; min-height: 40px; padding: 0 .4rem; border: 1px solid #536474; border-radius: .32rem; background: #212f3d; color: var(--mint); font-weight: 750; cursor: pointer; transition: background .18s, transform .18s; }
.symbols button:not(:disabled):hover { background: #35495b; transform: translateY(-2px); }
.symbols button:disabled { opacity: .46; cursor: default; }
.form-note { color: var(--mint); margin-top: .55rem; }
.dial-panel { isolation: isolate; position: relative; border-radius: .42rem 1.22rem .42rem .42rem; min-height: 344px; overflow: hidden; border: 1px solid #80dbc187; box-shadow: 0 11px 40px #9af4e128; display: flex; flex-direction: column; justify-content: flex-end; background: #142224; }
.dial-image, .dial-image::after { position: absolute; z-index: -1; inset: 0; }
.dial-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 33%; }
.dial-image::after { content: ''; z-index: 0; background: linear-gradient(0deg,#190f25 4%,#1d1329ef 28%,#2c214459 73%,#ffb3c719); }
.dial-box { padding: clamp(1.1rem, 2vw, 1.7rem); }
.dial-box h2 { font-size: clamp(1.6rem, 2.6vw, 2.5rem); }
.dial-text { margin-top: .5rem; font: 700 clamp(1.75rem, 3.3vw, 3.9rem)/1.14 var(--display); color: var(--muted); letter-spacing: .047em; overflow-wrap: anywhere; }
.dial-text.complete { color: var(--mint); text-shadow: 0 0 .48em #76ffd46a; }
.dial-status { color: var(--muted); margin: .35rem 0 .78rem; }
.dial-box .feedback { margin-top: .5rem; }

.casebook-filters { display: grid; grid-template-columns: minmax(17rem,.86fr) minmax(0,1fr); align-items: end; gap: 1rem 2rem; background: linear-gradient(125deg,#4c2744,#2c1b42 62%); border-color: #9e5881; }
.search-input { display: block; position: relative; }
.search-input .icon { position: absolute; z-index: 1; left: .65rem; top: .65rem; color: var(--rose); pointer-events: none; }
.search-input input { padding-left: 2.3rem; }
.filters { margin: 0; border: 0; padding: 0; min-inline-size: 0; display: flex; gap: .44rem; flex-wrap: wrap; }
.filters label { display: inline-grid; position: relative; cursor: pointer; }
.filters input { position: absolute; z-index: 1; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.filters span {
  padding: .45rem .68rem;
  border: 1px solid #5b5365;
  border-radius: 2rem;
  font-weight: 700;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.filters label:hover span { transform: translateY(-2px); border-color: var(--rose); }
.filters input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }
.filters input:checked + span { background: var(--rose); color: var(--accent-ink); border-color: var(--rose); }
.casebook-index { min-height: 2.7rem; padding-block: .6rem; color: var(--muted); }
.safe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; align-items: start; }
.disclosure { border: 1px solid var(--line); border-radius: .42rem .84rem .42rem .42rem; background: #291d3a; transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.disclosure:hover { border-color: color-mix(in srgb, var(--accent) 62%, #39304c); box-shadow: 0 7px 20px #080b1764; }
.disclosure[open] { background: #342243; }
.disclosure > summary { position: relative; min-height: 44px; padding: .78rem 2.7rem .78rem 1rem; font-weight: 800; border-radius: inherit; }
.disclosure > summary::before, .disclosure > summary::after { content: ''; position: absolute; top: 50%; right: 1rem; width: .8rem; height: 2px; border-radius: 2px; background: var(--accent); transition: transform .22s ease; }
.disclosure > summary::after { transform: rotate(90deg); }
.disclosure[open] > summary::after { transform: rotate(0deg); }
.safe-card { scroll-margin-block: 2rem; }
.safe-card:target { border-color: var(--rose); }
.safe-card summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; align-items: center; }
.safe-card summary > .icon { color: var(--rose); transition: transform .2s; }
.safe-card:hover summary > .icon { transform: scale(1.12); }
.safe-label { overflow-wrap: anywhere; line-height: 1.3; }
.safe-label > strong, .safe-label > span { display: block; }
.safe-label > span { color: var(--dim); margin-top: .18rem; font-weight: 550; }
.safe-type { color: var(--rose); line-height: 1.2; text-align: right; }
.safe-body { border-top: 1px solid #424058; padding: .8rem 1rem 1rem; }
.safe-result { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; }
.safe-result code { color: var(--rose); font-size: 1.7rem; font-weight: 800; letter-spacing: .09em; }
.safe-result + h3 { margin-block: .6rem .24rem; }
.safe-source { margin-top: .65rem; display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--rose); }
.safe-body .feedback { margin-top: .45rem; }


.atlas { margin-bottom: clamp(1.35rem, 3.8vw, 2.45rem); scroll-margin-top: 1rem; }
.atlas-shell {
  --accent: var(--mint);
  --map-height: clamp(25rem,60svh,42rem);
  background: linear-gradient(125deg,#332444,#231b37 73%);
  border: 1px solid #986689;
  border-top: 2px solid #ee9fbc;
  border-radius: .55rem 1.45rem .55rem .55rem;
  padding: clamp(.85rem, 2vw, 1.4rem);
  box-shadow: var(--shadow);
}
.atlas-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .8rem 1.1rem;
  margin-bottom: .95rem;
}
.atlas-heading { display: flex; align-items: center; gap: .7rem; }
.atlas-heading h2 { font-size: clamp(2.07rem,4vw,3.54rem); }
.atlas-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; }
.atlas-controls .button { padding-inline: .62rem; }
.atlas-zoom { width: 44px; padding: 0; color: var(--mint); background: #281e3d; border: 1px solid #8e6e9a; font-size: 1.45rem; }
.atlas-zoom:hover { background: #462e50; }
.atlas-level { font-variant-numeric: tabular-nums; min-width: 4ch; text-align: center; color: var(--muted); font-weight: 750; }
.atlas-expand-icon { display: inline-block; flex: 0 0 .92rem; width: .92rem; height: .92rem; color: var(--mint); background:
  linear-gradient(currentColor,currentColor) left top/38% 1.5px,
  linear-gradient(currentColor,currentColor) left top/1.5px 38%,
  linear-gradient(currentColor,currentColor) right top/38% 1.5px,
  linear-gradient(currentColor,currentColor) right top/1.5px 38%,
  linear-gradient(currentColor,currentColor) left bottom/38% 1.5px,
  linear-gradient(currentColor,currentColor) left bottom/1.5px 38%,
  linear-gradient(currentColor,currentColor) right bottom/38% 1.5px,
  linear-gradient(currentColor,currentColor) right bottom/1.5px 38%;
  background-repeat: no-repeat;
}
.atlas-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: .85rem; }
.atlas-grid.is-ready { grid-template-columns: minmax(0,1fr) minmax(13rem,.36fr); }
.atlas-screen { min-width: 0; min-height: 0; border-radius: .4rem .91rem .4rem .4rem; overflow: hidden; border: 1px solid #b87eaa69; }
.atlas-intro {
  display: grid;
  align-items: center;
  padding: clamp(1rem, 3vw, 2.08rem);
  min-height: clamp(10rem, 21vw, 16rem);
  background:
    linear-gradient(95deg,#180e27f1,#261536ac 41%,#3825431e),
    url('/images/biscayne-dusk.webp') center 62% / cover no-repeat,
    #20162c;
}
.atlas-intro-copy { max-width: 38rem; }
.atlas-intro-copy > p:first-child { margin-bottom: .72rem; color: var(--text); font-size: clamp(1rem,1.55vw,1.22rem); font-weight: 650; }
.atlas-intro .feedback { margin-top: .52rem; }
.atlas-viewport {
  position: relative;
  height: var(--map-height);
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(ellipse at center,#352743 5%,#1d162e 75%),
    #21162e;
}
.atlas-viewport:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.atlas-viewport.is-dragging { cursor: grabbing; }
.atlas-world, .atlas-marker-layer { position: absolute; inset: 0 auto auto 0; pointer-events: none; }
.atlas-world { transform-origin: 0 0; will-change: transform; }
.atlas-world img { width: 100%; max-width: none; }
.atlas-marker-layer { inset: 0; }
.atlas-pin {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  border-radius: 50%;
  color: #ffeef6;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.atlas-pin::after, .atlas-place-icon {
  content: '';
  display: block;
  width: .66rem;
  height: .66rem;
  border: 2px solid #fff1f6;
  border-radius: 50%;
  background: #943f74;
  box-shadow: 0 0 0 2px #3a193a9c;
}
.atlas-pin::after { transition: scale .16s ease, box-shadow .16s ease; }
.atlas-pin.is-selected::after, .atlas-pin:hover::after { scale: 1.48; background: #326956; box-shadow: 0 0 0 3px #8bf3d6c7,0 0 12px #167660; }
.atlas-pin.is-selected { z-index: 1; }
.atlas-sidebar {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
  max-height: calc(var(--map-height) + 2px);
  padding: .8rem;
  background: #201830;
  border: 1px solid #ae7fa660;
  border-radius: .38rem .9rem .38rem .38rem;
}
.atlas-sidebar .search-input .icon { color: var(--mint); }
.atlas-places { list-style: none; padding: 0 .15rem 0 0; margin: 0; min-height: 0; overflow: auto; scrollbar-color: #926393 #271c32; }
.atlas-places li + li { margin-top: .26rem; }
.atlas-places button {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  width: 100%;
  border: 1px solid #67466d87;
  border-radius: .3rem .66rem .3rem .3rem;
  padding: .42rem .58rem;
  background: #30223d;
  color: var(--text);
  cursor: pointer;
  text-align: start;
  line-height: 1.35;
  transition: background .2s ease, border-color .2s ease;
}
.atlas-places button:hover { border-color: var(--rose); background: #462a50; }
.atlas-places button[aria-pressed="true"] { border-color: var(--mint); background: #2b3d48; color: var(--mint); }
.atlas-place-icon { flex: 0 0 .66rem; }
.atlas-places button[aria-pressed="true"] .atlas-place-icon { background: #326956; box-shadow: 0 0 0 2px #8bf3d68c; }
.atlas-places button:focus-visible { outline-offset: -3px; }
.atlas-empty, .atlas-foot { color: var(--muted); }
.atlas-foot { display: grid; gap: .48rem; margin-top: .76rem; }
.atlas-links { display: flex; flex-wrap: wrap; gap: .28rem 1.14rem; }
.atlas-links a { color: var(--mint); }
.atlas-links a:hover { color: var(--text); }
.atlas-dialog {
  color: var(--text);
  background: var(--night);
  border: 0;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
}
.atlas-dialog[open] .atlas-shell {
  --map-height: max(20rem,calc(100dvh - 13rem));
  padding: .85rem max(.85rem,env(safe-area-inset-right)) max(.85rem,env(safe-area-inset-bottom)) max(.85rem,env(safe-area-inset-left));
  min-height: 100%;
  border: 0;
  border-radius: 0;
}
.atlas-dialog[open] .atlas-header { position: sticky; inset: 0 0 auto; z-index: 4; background: #302441; padding-block: .46rem; }
body:has(.atlas-dialog[open]) { overflow: hidden; }
@media (max-width: 740px) {
  .atlas-shell { --map-height: clamp(17rem,52svh,31rem); }
  .atlas-dialog[open] .atlas-shell { --map-height: max(16rem,calc(100dvh - 15rem)); }
  .atlas-grid.is-ready { grid-template-columns: minmax(0,1fr); }
  .atlas-sidebar { max-height: 14rem; }
  .atlas-controls .button { min-height: 41px; }
  .atlas-heading .badge-icon { width: 2.35rem; height: 2.35rem; }
}
@media (max-width: 480px) {
  .atlas-intro { background-position: center,61% center; }
  .atlas-controls { gap: .36rem; }
  .atlas-controls .button { padding-inline: .45rem; }
  .atlas-zoom { width: 39px; }
  .page-heading h1 { font-size: clamp(2.4rem,10.4vw,3.3rem); overflow-wrap: anywhere; }
}
@media (forced-colors: active) {
  .cover-copy em { background: none; color: CanvasText; }
  .atlas-pin::after, .atlas-place-icon { background-color: Highlight; border-color: ButtonText; forced-color-adjust: none; }
}

.print-studio { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(16rem,.7fr); align-items: start; gap: 1rem; scroll-margin-top: 1rem; }
.map-editor { border-color: #916d69; background: linear-gradient(145deg,#483039,#281d38 68%); }
.map-head { display: flex; gap: .9rem; }
.map-head h2, .cheat-download h2 { font-size: clamp(1.9rem, 3.2vw, 3.08rem); }
.map-head p { color: var(--muted); margin-top: .42rem; }
.map-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem .9rem; margin-block: 1rem; }
.map-file { flex: 1 1 100%; }
input[type="file"] { padding: .36rem .45rem; }
input::file-selector-button { font: inherit; font-weight: 700; color: var(--paper); background: #302939; border: 1px solid #695b58; border-radius: .25rem; padding: .25rem .4rem; margin-right: .55rem; cursor: pointer; }
.map-settings { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: .65rem; }
.map-output { display: flex; flex-wrap: wrap; align-items: center; gap: .64rem; margin-top: 1rem; }
.map-preview { border: 1px solid #ffffff26; margin: 1rem 0 0; background: #101725; padding: .7rem; border-radius: .55rem; }
.map-preview-sheet { width: min(100%, var(--sheet-width)); aspect-ratio: var(--sheet-ratio); position: relative; background: #fff; margin-inline: auto; overflow: hidden; box-shadow: 0 6px 16px #05091396; }
.map-preview-sheet > div { position: absolute; inset: var(--preview-inset-y) var(--preview-inset-x); }
.map-preview-sheet img { width: 100%; height: 100%; object-fit: contain; }
.map-preview-sheet.is-poster::before, .map-preview-sheet.is-poster::after { content: ''; position: absolute; z-index: 1; pointer-events: none; }
.map-preview-sheet.is-poster::before { inset: 0 auto 0 50%; border-left: 1px dashed #59360f; }
.map-preview-sheet.is-poster::after { inset: 50% 0 auto; border-top: 1px dashed #59360f; }
.map-preview figcaption { color: var(--muted); overflow-wrap: anywhere; padding-top: .45rem; }
.cheat-download {
  border-radius: .7rem;
  padding: clamp(1rem, 2.3vw, 1.5rem);
  background: radial-gradient(ellipse at 87% 14%,#71434d,#3b2242 66%);
  border: 1px solid #a1737a;
  box-shadow: var(--shadow);
}
.cheat-download header { display: grid; gap: .8rem; }
.cheat-download p { color: #e6d9df; margin-block: .55rem 1rem; }
.cheat-download .text-link { display: block; width: fit-content; margin-top: .7rem; }
.cheats-block { margin-top: 2.3rem; }
.cheats-block .section-top { margin-bottom: .8rem; }
.cheats-block .section-top p { color: var(--muted); margin-top: .45rem; }
.cheats-table .directions code { font: 750 1.14em/1.35 'Cascadia Mono','Segoe UI Symbol',sans-serif; color: var(--paper); white-space: nowrap; }

.guide { margin-top: clamp(2.8rem, 6.5vw, 5.6rem); display: grid; gap: clamp(2rem, 4.7vw, 4.2rem); }
.guide > section > h2 { margin-bottom: .9rem; }
.guide p { color: var(--muted); }
.guide-intro { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.82fr); gap: clamp(1rem, 3.3vw, 3.5rem); align-items: center; }
.guide-intro h3 { margin-top: .95rem; }
.guide-intro p { margin-top: .57rem; }
.guide-intro figure { margin: 0; overflow: hidden; border-radius: .42rem 1rem .42rem .42rem; border: 1px solid var(--line); background: #291a38; }
.guide-intro figure img { width: 100%; aspect-ratio: 1.76; object-fit: cover; }
.guide-intro figcaption { color: var(--muted); padding: .46rem .65rem; }
.guide--safes .guide-intro { grid-template-columns: minmax(0,.82fr) minmax(0,1.15fr); }
.guide--safes .guide-intro figure { grid-column: 1; grid-row: 1; }
.guide--safes .guide-intro > div { grid-column: 2; grid-row: 1; }
.step-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-grid li { counter-increment: step; min-width: 0; border-radius: .42rem .94rem .42rem .42rem; border: 1px solid #ffb1e239; background: linear-gradient(135deg,#33213e,#251a34); padding: 1rem; transition: border-color .2s, transform .2s, box-shadow .2s; }
.step-grid li:hover, .tips article:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.step-grid li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  width: fit-content;
  margin-bottom: .48rem;
  padding: .23rem .42rem;
  color: var(--accent);
  font: 750 1.09rem/1 var(--display);
  background: color-mix(in srgb,var(--accent) 9%,transparent);
  border: 1px solid color-mix(in srgb,var(--accent) 38%,transparent);
  border-radius: .26rem;
}
.step-grid p, .tips p { margin: .55rem 0 0; }
.worked { display: flex; align-items: center; gap: .9rem 1.2rem; padding: clamp(1rem, 2.6vw, 1.9rem); background: linear-gradient(130deg,color-mix(in srgb,var(--accent) 18%,#241433),#271937 82%); border: 1px solid color-mix(in srgb,var(--accent) 38%,#3b2c44); border-radius: .42rem .94rem .42rem .42rem; }
.worked p { margin-top: .5rem; max-width: 90ch; }
.tips { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; }
.tips article { background: #291b39; border: 1px solid var(--line); border-top: 2px solid color-mix(in srgb, var(--accent), transparent 49%); border-radius: .42rem .94rem .42rem .42rem; padding: .9rem; transition: border-color .2s, transform .2s, box-shadow .2s; }
.faq { margin-top: .5rem; }
.faq p { padding: 0 1rem .85rem; }
.sources ul { display: flex; flex-wrap: wrap; column-gap: 1.75rem; row-gap: .35rem; margin: 0; padding-left: 1.25rem; }
.sources a { color: var(--accent); }
.sources a:hover { color: var(--text); }
.related .tool-grid { grid-template-columns: 1fr 1fr; }
table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; background: #251a35; }
th, td { padding: .6rem .85rem; text-align: start; }
thead { background: #3c2546; }
thead th { color: var(--accent); }
tbody tr:nth-child(even) { background: #301e3d; }
tbody th { font-weight: 650; }
tbody th span { display: block; color: var(--muted); font-weight: 500; margin-top: .22rem; }
tbody td { color: var(--muted); }
.anomalies td:last-child { min-width: 5.2rem; }
.anomalies td code { display: block; color: var(--text); }
.anomalies td { white-space: nowrap; }
.contact-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0,1.4fr) minmax(17rem,.6fr); align-items: start; }
.contact-form { display: grid; gap: .95rem; }
.contact-form button { justify-self: start; }
.contact-side h2, .privacy-grid h2 { margin-top: .5rem; }
.contact-side p, .privacy-grid p { color: var(--muted); margin-block: .58rem; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.privacy-links { padding-left: 1.25rem; }
.privacy-links a { color: var(--accent); }
.footer {
  position: relative;
  background: linear-gradient(90deg,#1b102bee,#1c1029c6 55%,#26172ba4), url('/images/biscayne-dusk.webp') center 61% / cover no-repeat, #1a122a;
  border-top: 1px solid #ffb1d03b;
  padding-block: clamp(2.4rem, 5vw, 4.2rem);
}
.footer::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--coastline); opacity: .8; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.5rem; }
.footer p { color: var(--muted); margin-top: .6rem; }
.footer nav { display: flex; flex-wrap: wrap; align-content: center; gap: .45rem .9rem; }
.footer nav a { color: var(--muted); }
.footer nav a:hover { color: var(--mint); }

:lang(ja) { --display: 'Noto Sans JP Variable', system-ui, sans-serif; line-break: strict; }
:lang(ja) .cover-copy h1 { font-size: clamp(3.2rem, 6.65vw, 7rem); line-height: 1.09; }
:lang(ja) h1, :lang(ja) h2 { line-height: 1.18; letter-spacing: -.035em; }
:lang(ja) .brand, :lang(ja) .dial-text { font-family: 'Barlow Condensed', sans-serif; }
:lang(ja) .page-heading h1 { font-size: clamp(2.3rem, 5.1vw, 4.65rem); font-style: normal; }

@media (max-width: 1020px) {
  .masthead-inner { column-gap: 1rem; }
  .tabs { column-gap: .9rem; }
  .casebook-filters { align-items: start; grid-template-columns: minmax(0,1fr); gap: .75rem; }
  .notebook { grid-template-columns: minmax(0,1fr) minmax(218px,.53fr); }
  .notebook-head, .clue-row { grid-template-columns: 5.4rem minmax(6rem,1fr) minmax(3.2rem,.68fr) 2.6rem; gap: .42rem; }
}
@media (max-width: 820px) {
  .masthead-inner { grid-template-columns: minmax(0,1fr) max-content; min-height: 0; padding-block: .55rem 0; gap: .35rem .75rem; }
  .tabs { justify-content: flex-start; grid-row: 2; grid-column: 1 / -1; column-gap: 1.26rem; }
  .tabs a { padding: .52rem 0 .63rem; }
  .tabs a::after { bottom: 0; }
  .dial-panel { min-height: 305px; }
  .safe-card summary { grid-template-columns: auto minmax(0,1fr); }
  .safe-type { grid-column: 2; text-align: start; }
  .tool-grid { gap: .65rem; }
  .tool-card-copy { padding: .8rem; }
  .home-cover::after { background: linear-gradient(90deg,#1d1025ef,#20112ca1 62%,#21153036),linear-gradient(0deg,#190f25dc,transparent 66%); }
  .cheats-table .directions code { white-space: normal; }
}
@media (max-width: 670px) {
  :root { font-size: 15px; }
  .wrap { width: min(100% - 2rem, 1240px); }
  .brand { gap: .6rem; }
  .brand-mark { width: 30px; height: 30px; }
  .tabs { column-gap: clamp(.56rem,3vw,1.1rem); }
  .tabs a { padding-block: .42rem .52rem; white-space: normal; }
  .locale-selector summary { min-height: 40px; }
  .cover-copy { padding-block: 3.1rem 3.3rem; }
  .cover-copy h1 { min-width: 0; overflow-wrap: normal; font-size: clamp(3.6rem, 12.6vw, 6.5rem); }
  .home-cover { min-height: 401px; }
  .cover-image { object-position: 57% center; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { display: grid; grid-template-columns: minmax(0,.48fr) minmax(0,1fr); }
  .tool-card img { align-self: stretch; height: 100%; }
  .tool-card:not(:has(img)) { display: block; }
  .home-field { grid-template-columns: 1fr; gap: .65rem; }
  .field-mark { width: 50px; min-width: 0; height: 50px; }
  .notebook { grid-template-columns: 1fr; }
  .dial-panel { min-height: 225px; }
  .dial-image img { object-position: center 38%; }
  .safe-grid, .contact-grid, .privacy-grid, .print-studio, .guide-intro, .guide--safes .guide-intro, .tips, .step-grid { grid-template-columns: 1fr; }
  .safe-card summary { grid-template-columns: auto minmax(0,1fr) auto; }
  .safe-type { grid-column: auto; text-align: right; }
  .guide--safes .guide-intro figure, .guide--safes .guide-intro > div { grid-row: auto; grid-column: auto; }
  .guide-intro figure { max-width: 32rem; }
  .worked { align-items: flex-start; }
  .footer-inner { grid-template-columns: 1fr; }
  .cheats-table th, .cheats-table td, .anomalies th, .anomalies td { padding: .42rem .44rem; }
}
@media (max-width: 400px) {
  :root { font-size: 14px; }
  .wrap { width: calc(100% - 1.55rem); }
  .home-cover { min-height: 370px; }
  .cover-copy h1 { font-size: clamp(3.3rem, 12.4vw, 4.35rem); }
  .cover-actions { gap: .44rem; }
  .cover-actions .button { min-height: 42px; }
  .tool-card { grid-template-columns: minmax(0,.42fr) minmax(0,1fr); }
  .safe-card summary { grid-template-columns: auto minmax(0,1fr); }
  .safe-type { grid-column: 2; text-align: start; }
  .related .tool-grid { grid-template-columns: 1fr; }
  .map-settings { grid-template-columns: 1fr 1fr; }
  .map-settings > :last-child { grid-column: 1 / -1; }
  .anomalies td:last-child { min-width: 0; }
}
@media (max-width: 480px) {
  .notebook-head { display: none; }
  .clue-row { grid-template-columns: minmax(0,1.62fr) minmax(0,1fr) 2.4rem; align-items: end; padding-block: .53rem .65rem; }
  .clue-date { grid-column: 1 / -1; }
  .clue-row label { display: grid; gap: .16rem; }
  .field-caption { display: block; color: var(--dim); line-height: 1.25; }
  .clue-row input, .clue-row select { padding-inline: .38rem; }
  .row-hint { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 .58rem; }
  .tabs a { width: fit-content; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
