html,
body {
  overflow: hidden;
}
  
  .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.town-section {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ==============================
  マップ本体
============================== */

.town-map-wrap {
  --map-ratio: 16 / 9;
  --map-ratio-number: 1.777777;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  background: #dff4ff;
  overflow: hidden;
}

.town-map-stage {
  /*
    マップ画像・クリック範囲・ピンを同じ比率枠内に配置。
    画面サイズが変わっても、%指定の座標は画像に追従します。
  */
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100dvh * var(--map-ratio-number)));
  max-width: 100vw;
  max-height: 100dvh;
  aspect-ratio: var(--map-ratio);
}

.town-map-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to right, #dff4ff 0%, rgba(223, 244, 255, 0) 4%, rgba(223, 244, 255, 0) 96%, #dff4ff 100%),
    linear-gradient(to bottom, #dff4ff 0%, rgba(223, 244, 255, 0) 4%, rgba(223, 244, 255, 0) 96%, #dff4ff 100%);
}

.town-map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.town-logo {
    position: absolute;
    top: clamp(10px, 2vw, 38px);
    right: clamp(8px, 1.5vw, 42px);
    z-index: 12;
    width: clamp(120px, 17vw, 300px);
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
}


/* ==============================
  左上メニュー
============================== */

.town-menu {
  position: fixed;
  top: clamp(12px, 2vw, 24px);
  left: clamp(12px, 2vw, 24px);
  /* 親ページパネル（z-index:30）より下に配置 */
  z-index: 25;
}

.town-menu-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(23, 42, 66, 0.18);
  cursor: pointer;
}

.town-menu-button span {
  position: absolute;
  left: 15px;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #2c3440;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.town-menu-button span:nth-child(1) {
  top: 17px;
}

.town-menu-button span:nth-child(2) {
  top: 25px;
}

.town-menu-button span:nth-child(3) {
  top: 33px;
}

.town-menu.is-open .town-menu-button span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.town-menu.is-open .town-menu-button span:nth-child(2) {
  opacity: 0;
}

.town-menu.is-open .town-menu-button span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.town-menu-panel {
  position: absolute;
  top: 64px;
  left: 0;
  width: min(78vw, 320px);
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
}

.town-menu.is-open .town-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.town-menu-section + .town-menu-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 42, 55, 0.1);
}

.town-menu-section a.town-menu-link {
    display: inline-flex;
    padding: 8px 20px;
    border-radius: 6px;
    background: #cf5050;
    font-weight: bold;
    color: #fff;
    align-items: center;
}
.town-menu-section a.town-menu-link::before {
    font-family: 'design_plus';
    content: '\e88a';
    margin: 0 5px 0 0;
    font-size: 18px;
    vertical-align: middle;
    line-height: 0;
}
.town-menu-parent-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: none;
    border-radius: 10px;
    color: #2c3440;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.town-menu-link:hover,
.town-menu-parent-link:hover,
.town-menu-link:focus-visible,
.town-menu-parent-link:focus-visible {
  background: #f3f8fb;
}

.town-menu-parent-list {
    display: grid;
    gap: 4px;
    margin: 0 0 10px 0 !important;
    padding: 0;
    list-style: none !important;
}

.town-menu-parent-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55em;
}

.town-menu-parent-link::before {
  font-family: 'design_plus';
  content: '\e927';
  display: inline-block;
  flex: 0 0 auto;
  color: #cf5050;
  font-size: 16px;
  font-weight: normal;
  line-height: 1;
}

/* ==============================
  建物全体をクリック・ホバー範囲にする
============================== */

.town-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  width: var(--w);
  height: var(--h);
  border: none;
  background: rgba(255, 255, 255, 0);
  padding: 0;
  cursor: pointer;
}

/*
  開発中にホットスポット範囲を確認したい場合は、下記のコメントアウトを外す

.town-spot {
  background: rgba(255, 0, 0, 0.18);
  outline: 2px solid rgba(255, 0, 0, 0.45);
}
*/

.pin {
  /* ピン自体の大きさは画面サイズで変えない */
  position: absolute;
  left: 50%;
  top: 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  color: #cf5050;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22));
  transform: translate(-50%, 8px) scale(0.75);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pin::before {
  font-family: 'design_plus';
  content: '\e927';
  display: block;
  font-size: 42px;
  font-weight: normal;
  line-height: 1;
}

.spot-label {
  /* ラベルの文字・余白は画面サイズで変えない */
  position: absolute;
  left: calc(50% + 28px);
  top: 12%;
  display: block;
  min-width: max-content;
  padding: 6px 16px;
  color: #222;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(23, 42, 66, 0.18);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.town-spot.label-left .spot-label {
    left: auto;
    right: calc(50% + 28px);
}


.town-spot:hover,
.town-spot:focus-visible,
.town-spot.is-active {
  z-index: 10;
}

.town-spot:hover .pin,
.town-spot:focus-visible .pin,
.town-spot.is-active .pin {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.town-spot:hover .spot-label,
.town-spot:focus-visible .spot-label,
.town-spot.is-active .spot-label {
  opacity: 1;
  transform: translateY(0);
}


/* ==============================
  ウェルカム画面
============================== */

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.65s ease,
    visibility 0.65s ease,
    background 0.65s ease;
}

.welcome-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.28);
}

.welcome-modal-box {
  position: relative;
  width: min(92vw, 680px);
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  text-align: center;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}

.welcome-modal.is-open .welcome-modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.welcome-modal-box {
  position: relative;
  width: min(92vw, 680px);
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  text-align: center;
}

.welcome-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 38px;
  font-weight: 200;
  line-height: 1;
  cursor: pointer;
}

.welcome-close:hover {
  opacity: 0.55;
}

.welcome-title {
    margin: 20px 0;
    font-size: clamp(22px, 2.5vw, 24px);
    line-height: 1.4;
}

.welcome-title strong {
    font-weight: 900;
    font-size: clamp(22px, 2.5vw, 24px);
}

.welcome-map {
  width: 100%;
  aspect-ratio: 16 / 6;
  margin: 0 auto 22px;
  border-radius: 14px;
  background-image: url("/wp2023/wp-content/themes/haku_tcd080-child/rubicjp-town/imgs/rubicjp-townmap_ss.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.welcome-text {
    margin: 0 0 24px;
    color: #3c4856;
}

.welcome-text::before {
    font-family: 'design_plus';
    content: '\e927';
    display: inline-block;
    font-size: 20px;
    color: #cf5050;
    line-height: 0;
}

.welcome-lead {
  margin: 0 0 10px;
  color: #2c3440;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.6;
}

.welcome-library-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 13px 28px;
  border: none;
  border-radius: 999px;
  color: #fff;
  background: #cf5050;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sp-word {
  display: none;
}

/* ==============================
  親ページパネル
============================== */

.town-panel {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: min(61.8vw, 1080px);
  height: 100vh;
  background: #fff;
  box-shadow: 16px 0 45px rgba(0, 0, 0, 0.18);
  transform: translateX(-105%);
  transition: transform 0.38s ease;
  overflow-y: auto;
}

/* 親パネル内の汎用画像フレーム */
.town-panel .innerimg_frame {
  display: flex;
  margin: 0 0 2em 0;
  width: 100%;
}

.town-panel .annot {
    display: block;
    font-size: 12px;
}

/* ISO画像用 */
.town-panel .innerimg_frame.iso {
    gap: 1em;
}
.town-panel .innerimg_frame.iso img {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
  object-fit: contain;
}

.town-panel.is-open {
  transform: translateX(0);
}

.town-panel.is-sub-open .panel-close {
  display: none;
}

.panel-close,
.welcome-close,
.sub-panel-close {
  position: absolute;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  color: #333;
  background: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}

.panel-close::before,
.welcome-close::before,
.sub-panel-close::before {
  font-family: 'design_plus';
  content: '\e91a';
  display: block;
  font-size: 22px;
  font-weight: normal;
  line-height: 1;
}

.panel-close:hover,
.welcome-close:hover,
.sub-panel-close:hover {
  opacity: 0.55;
}

/* 親パネルの閉じるボタン */
.panel-close {
  top: 18px;
  right: 12px;
  z-index: 40;
}

/* ウェルカムモーダルの閉じるボタン */
.welcome-close {
  top: 12px;
  right: 16px;
  z-index: 40;
}

/* 下層パネルの閉じるボタン */
.sub-panel-close {
  top: 18px;
  right: 12px;
  z-index: 65;
}

.panel-render {
  min-height: 100%;
}

/* パネル表示中の背景クリック領域 */
.town-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  border: none;
  background: rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.town-overlay.is-open {
  display: block;
}

/* ==============================
  親ページ共通UI：Group101(2)
============================== */

.panel-inner {
  padding: clamp(56px, 7vw, 80px) clamp(34px, 3vw, 76px);
}

.panel-content-grid {
  display: grid;
  grid-template-columns: minmax(220px, 36%) minmax(320px, 1fr);
  gap: clamp(34px, 5vw, 50px);
  align-items: start;
}

.panel-visual {
  position: sticky;
  top: 92px;
  padding-top: 190px;
}

.panel-map-circle {
  width: min(100%, 290px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background-image: url("/wp2023/wp-content/themes/haku_tcd080-child/rubicjp-town/imgs/rubicjp-townmap_s.jpg");
  background-size: 520%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.panel-text {
  max-width: 620px;
}

.headline-marker {
    margin: 0 0 46px;
    color: #2c3440;
    font-size: clamp(22px, 2.2vw, 40px);
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: 0.08em;
}

.headline-marker span {
  display: inline;
  padding: 0 0.12em;
  background: linear-gradient(transparent 58%, #fff2a8 58%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.headline-marker span::after {
  content: "\A";
  white-space: pre;
}

.panel-media {
  width: 100%;
  margin-bottom: 46px;
  overflow: hidden;
}
.panel-media .annot {
    text-align: right;
    font-size: 12px;
}
.media-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.panel-body {
    /* display: grid; */
    /* gap: 14px; */
    /* margin-bottom: 30px; */
}

.panel-body .cardlink {
    margin: 0 0 20px 0 !important;
}

.panel-body .cardlink .desc span {
    display: none;
}

.panel-body a.q_custom_button3 {
    padding: 10px 40px;
}

/* ==============================
  かいみん図書館：Group101(1)
============================== */

.library-grid {
  display: grid;
  grid-template-columns: minmax(220px, 35%) minmax(340px, 1fr);
  gap: clamp(34px, 3.5vw, 70px);
  align-items: start;
}

.library-visual {
  position: sticky;
  top: 92px;
  padding-top: 190px;
}

.library-content {
  max-width: 620px;
}

.book-section {
  margin: 0 0 34px;
}

.book-section h2, .book-section h2 {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 18px;
    padding: 0 14px;
    color: #fff;
    background: #cf5050;
    font-size: 16px !important;
    line-height: 1.2;
}

.book-link {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid rgba(31, 42, 55, 0.1);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.book-link::after {
    font-family: 'design_plus';
    content: '\e910';
    position: absolute;
    right: 5px;
    top: 50%;
    font-size: 14px;
    transform: translateY(-50%);
}

.book-link:hover {
  background: #fafafa;
}

.book-title {
    display: block;
    font-weight: bold;
    font-size: 22px;
    letter-spacing: -1px;
}


/* かいみん図書館：一覧タイトルの「」は疑似要素で表示 */
.book-desc {
    display: block;
    margin: 6px 0;
    color: #7d7d7d;
    font-size: 14px;
}

/* ==============================
  下層ページパネル
  1カラム：見出し・テキスト
  親ページのスクロールに依存しない全面表示
============================== */

.sub-panel {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: min(56vw, 1080px);
  height: 100vh;
  background: #fff;
  box-shadow: 16px 0 45px rgba(0, 0, 0, 0.22);
  transform: translateX(-105%);
  transition: transform 0.38s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sub-panel.is-open {
  transform: translateX(0);
}

.sub-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 59;
  display: none;
  border: none;
  background: rgba(15, 23, 42, 0.16);
  cursor: pointer;
}

.sub-panel-overlay.is-open {
  display: block;
}


.sub-panel-render {
  min-height: 100%;
}

.sub-panel-inner {
  margin: 0 auto;
  padding: clamp(62px, 8vw, 80px) clamp(30px, 5vw, 72px) 80px;
}

/* 下層ページの本タイトルだけ太字にする
   ※ .sub-panel h2 にすると、カテゴリ見出し（.book-section h2）にも効くため対象を限定 */
.sub-panel-inner > h2.rich_font_type3 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 40px);
    text-align: center;
    font-weight: bold;
}



/* 下層ページ上部のカテゴリ見出しは、親ページの .book-section h2 と同じ見た目に固定 */
.sub-panel .sub-panel-book-section h2 {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 18px;
    padding: 0 14px;
    color: #fff;
    background: #cf5050;
    font-size: 16px !important;
    line-height: 1.2;
    text-align: left;
    font-weight: normal;
}

.sub-panel-lead {
    margin: 0 0 50px !important;
    color: #7d7d7d;
    font-size: clamp(14px, 1.2vw, 40px);
    line-height: 2;
    text-align: center;
}

.sub-panel-body {
    display: grid;
    gap: 24px;
    margin: 0 0 50px 0;
}

.note-section {
  padding-bottom: 12px;
}

.note-section h3 {
  margin: 0 0 22px;
  color: #2c3440;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

/* 大学ノートのような罫線：pに依存させず、note-section全体に表示
   ※ em指定だと、親要素とpのfont-size差でスマホ時に罫線がずれやすいためpx基準に固定 */
.note-section {
  --note-font-size: 16px;
  --note-line-height: 34.4px; /* 16px × 2.15 */
  position: relative;
  padding-bottom: var(--note-line-height);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--note-line-height) - 1px),
    #ddd calc(var(--note-line-height) - 1px),
    #ddd var(--note-line-height)
  );
  background-repeat: repeat;
  background-size: 100% var(--note-line-height);
}

/* pの余白も1行分として扱うため、空いた行にも罫線が入ります */
.note-section p {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--note-line-height);
  padding: 0;
  color: #3c4856;
  font-size: var(--note-font-size);
  line-height: var(--note-line-height);
  background: transparent;
}

.note-section p:last-child {
  margin-bottom: 0;
}

.note-section p.topics {
    margin: calc(var(--note-line-height) * 2) 0 0;
    color: #be4a57;
    font-weight: bold;
}

.note-section p.topics::before {
    font-family: 'design_plus';
    content: '\f02b';
    margin: 0 6px 0 0;
    font-size: 20px;
    line-height: 0;
}
.note-section a.link_button {
    display: flex;
    width: fit-content;
    margin: 0 auto;
    background: #3c4856;
    color: #fff;
    padding: 0px 20px;
    border-radius: 50px;
    cursor: pointer;
    align-items: center;
}
.note-section strong {
  font-weight: 700;
  background: linear-gradient(transparent 60%, #fff3a3 60%);
  padding: 0 0.08em;
}

.note-section .innerimg_frame {
    display: block;
    float: left;
    width: 40%;
    margin: 10px 20px 10px 10px;
    padding: 15px;
    background: #fff;
    box-sizing: border-box;
    line-height: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.note-section .innerimg {
    position: relative;
}

.note-section .innericn {
    position: absolute;
    left: 0;
    top: 0;
    width: 15%;
}

section.note-section ul {
    margin-bottom: var(--note-line-height);
}

section.note-section ul li {
    line-height: var(--note-line-height);
}

/* 旧JS生成罫線が残った場合は非表示 */
.note-rule-lines,
.note-rule-line {
  display: none !important;
}


/* ==============================
  クリック可能箇所の一時表示アニメーション
  親ページ・下層ページが閉じた直後に約1.5秒表示
============================== */

.town-map-wrap.is-spot-hinting .town-spot .pin {
  animation: spotHintPin 4s ease both;
  animation-delay: var(--hint-delay, 0s);
}

.town-map-wrap.is-spot-hinting .town-spot .spot-label {
  animation: spotHintLabel 4s ease both;
  animation-delay: var(--hint-delay, 0s);
}

@keyframes spotHintPin {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.45);
  }

  6% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.12);
  }

  11% {
    opacity: 1;
    transform: translate(-50%, 4px) scale(0.94);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, -3px) scale(1.03);
  }

  20%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.75);
  }
}

@keyframes spotHintLabel {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }

  6% {
    opacity: 1;
    transform: translateY(-10px) scale(1.08);
  }

  11% {
    opacity: 1;
    transform: translateY(4px) scale(0.96);
  }

  15% {
    opacity: 1;
    transform: translateY(-3px) scale(1.02);
  }

  20%,
  82% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}


@keyframes spotHintPinHold {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.45);
  }

  45% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.1);
  }

  70% {
    opacity: 1;
    transform: translate(-50%, 3px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes spotHintLabelHold {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }

  45% {
    opacity: 1;
    transform: translateY(-8px) scale(1.06);
  }

  70% {
    opacity: 1;
    transform: translateY(3px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}



/* ==============================
  スマホ用：横スクロール案内アイコン
============================== */

.town-scroll-arrow {
  display: none;
}

/* ==============================
  スマホ対応
============================== */



/* ==============================
  パネル最下部の閉じるボタン
============================== */

.panel-bottom-close-wrap {
    display: flex;
    justify-content: center;
    padding: 0 0 40px 0;
}

.panel-bottom-close {
    display: inline-flex;
    gap: 2px;
    border: none;
    background: none;
    cursor: pointer;
    align-items: center;
    font-size: 12px;
}

.panel-bottom-close::before {
    font-family: 'design_plus';
    content: '\e91a';
    display: block;
    font-size: 20px;
}

.panel-bottom-close:hover {
  opacity: 0.65;
  background: #f8fafc;
  border-color: rgba(44, 52, 64, 0.75);
}

@media (max-width: 900px) {
  .town-map-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100dvh;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .town-map-stage {
    position: relative;
    flex: 0 0 calc(100dvh * var(--map-ratio-number));
    width: calc(100dvh * var(--map-ratio-number));
    min-width: calc(100dvh * var(--map-ratio-number));
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
  }

  .town-map-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .town-scroll-arrow {
    position: fixed;
    top: 50%;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: #999;
    background: rgb(255 255 255 / 80%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .town-scroll-arrow::before {
    font-family: 'design_plus';
    content: '\e910';
    display: block;
    font-size: 24px;
    font-weight: normal;
    line-height: 1;
  }

  .town-scroll-arrow-left {
    left: 0px;
    transform: translateY(-50%) rotate(180deg);
    border-radius: 6px 0 0 6px;
  }

  .town-scroll-arrow-right {
    right: 0px;
    transform: translateY(-50%);
    border-radius: 6px 0 0 6px;
  }

  .town-map-wrap.can-scroll-left .town-scroll-arrow-left,
  .town-map-wrap.can-scroll-right .town-scroll-arrow-right {
    opacity: 1;
    visibility: visible;
  }

  .town-logo {
    position: fixed;
  }

  .town-panel {
    width: 100%;
  }

  .sub-panel {
    width: 100%;
  }


  .town-panel,
  .sub-panel {
    touch-action: pan-y;
  }

  .panel-close,
  .sub-panel-close {
    right: 12px;
  }

  .panel-content-grid,
  .library-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .panel-visual,
  .library-visual {
    position: static;
    padding-top: 0;
  }

  .panel-map-circle {
    width: min(42vw, 260px);
  }

  /* スマホ：ランダム表示前は非表示 */
  .town-map-wrap:not(.is-spot-hinting):not(.is-spot-hinted) .town-spot .pin,
  .town-map-wrap:not(.is-spot-hinting):not(.is-spot-hinted) .town-spot .spot-label {
    opacity: 0;
  }

  /* スマホ：ランダム表示後は表示したまま固定 */
  .town-map-wrap.is-spot-hinted .town-spot .pin,
  .town-map-wrap.is-spot-hinted .town-spot .spot-label {
    opacity: 1;
  }

  .town-map-wrap.is-spot-hinted .town-spot .pin {
    transform: translate(-50%, 0) scale(1);
  }

  .town-map-wrap.is-spot-hinted .town-spot .spot-label {
    transform: translateY(0);
  }

  /* スマホ：最後に消えないアニメーションへ変更 */
  .town-map-wrap.is-spot-hinting .town-spot .pin {
    animation: spotHintPinHold 1.4s ease both;
    animation-delay: var(--hint-delay, 0s);
  }

  .town-map-wrap.is-spot-hinting .town-spot .spot-label {
    animation: spotHintLabelHold 1.4s ease both;
    animation-delay: var(--hint-delay, 0s);
  }

  .sub-panel-inner {
    max-width: none;
    padding: 72px 24px calc(96px + env(safe-area-inset-bottom));
  }

  .welcome-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow-y: auto;
  }

  .welcome-modal-box {
    width: min(92vw, 520px);
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
    margin: auto;
    padding: 30px 20px 28px;
  }

  .welcome-map {
    aspect-ratio: 16 / 8;
  }

  .pc-word {
    display: none;
  }

  .sp-word {
    display: inline;
  }

  .welcome-library-button {
    min-width: 200px;
    font-size: 16px;
  }

  .panel-bottom-close-wrap {
    padding: 20px 20px calc(72px + env(safe-area-inset-bottom));
  }

  .panel-bottom-close {
    padding: 6px 20px;
    font-size: 12px;
  }


  .town-menu {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }

  .town-menu-button {
    width: 48px;
    height: 48px;
  }

  .town-menu-button span {
    left: 14px;
    width: 20px;
  }

  .town-menu-button span:nth-child(1) {
    top: 16px;
  }

  .town-menu-button span:nth-child(2) {
    top: 24px;
  }

  .town-menu-button span:nth-child(3) {
    top: 32px;
  }

  .town-menu-panel {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    box-sizing: border-box;
    border-radius: 0;
  }

}

@media (max-width: 600px) {
  .note-section {
    --note-font-size: 15px;
    --note-line-height: 32.25px; /* 15px × 2.15 */
  }

  .panel-inner {
    padding: 56px 22px 42px;
  }

  .book-title {
    font-size: 18px;
  }

  .book-desc {
    font-size: 12px;
  }

  .note-section .innerimg_frame {
    float: none;
    clear: both;
    width: 100%;
    height: calc(var(--note-line-height) * 10);
    margin: 0 0 var(--note-line-height) 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .note-section .innerimg_frame .innerimg {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }

  .note-section .innericn {
    left: 2%;
    top: 2%;
  }

}

/* ==============================
  説明テキスト左右の「～」装飾
============================== */

/* book-section内の説明文は左寄せ */
.book-section .book-desc {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6em;
  text-align: left;
}

/* sub-panel内のリード文は中央寄せ */
.sub-panel .sub-panel-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  text-align: center;
}



