:root {
  --color-bg: #f6efdf;
  --color-bg-alt: #efe4cc;
  --color-text: #372c1f;
  --color-text-soft: #6b5d47;
  --color-accent: #c9a675;
  --color-line: #d8c9a5;
  --font-heading: 'Kaisei Opti', serif;
  --font-body: 'Noto Sans JP', sans-serif;
  --font-prose: 'Zen Old Mincho', serif;
  --shadow-soft: 0 8px 24px rgba(55, 44, 31, 0.15);
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 32px;
  padding-top: calc(22px + env(safe-area-inset-top));
  position: relative;
  z-index: 10;
  background: #e8dabf;
  flex-shrink: 0;
}

.site-header .site-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  transition: opacity 0.2s ease;
}

.site-header .site-name:hover {
  opacity: 0.75;
}

.sns-links {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.9rem;
}

.sns-links li {
  display: flex;
}

.sns-links a {
  display: inline-flex;
  align-items: center;
  height: 1.7em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}

.sns-links a:hover {
  border-color: currentColor;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.map-icon {
  position: absolute;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  animation: float 6s ease-in-out infinite;
}

.icon-particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.map-icon .frame-window,
.browse-jump-item .frame-window {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-icon img.character-thumb,
.browse-jump-item img.character-thumb {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.map-icon img.deco-frame,
.map-icon svg.deco-frame,
.browse-jump-item img.deco-frame,
.browse-jump-item svg.deco-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-icon:hover .frame-window,
.map-icon:focus-visible .frame-window {
  filter: drop-shadow(0 0 6px rgba(201, 166, 117, 0.6));
}

@keyframes float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -14px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-icon {
    animation: none;
  }

  .browse-world-icons .map-icon.is-active .frame-window {
    animation: none;
  }

  .scroll-hint-bounce {
    animation: none;
  }
}

#browse-root {
  flex: 1 1 auto;
  min-height: 0;
}

.browse {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.browse-camera {
  position: relative;
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #201a12;
}

.browse-world {
  position: absolute;
  top: 0;
  left: 0;

  height: 200%;
  width: auto;
  aspect-ratio: 1672 / 941;
  will-change: transform;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.camera-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
}

.detail-scroll-hint {
  display: none;
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.detail-scroll-hint.is-hidden {
  opacity: 0;
}

.scroll-hint-label {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
}

.scroll-hint-bounce {
  display: block;
  animation: scroll-hint-bounce 1.8s ease-in-out infinite;
}

.scroll-hint-arrow {
  display: block;
  width: 22px;
  height: 22px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
}

@keyframes scroll-hint-bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

.browse-world-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.browse-world-icons {
  position: absolute;
  inset: 0;
}

.browse-world-icons .map-icon {
  opacity: 0.5;
  transition: opacity 0.5s ease, transform 0.5s ease;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.browse-world-icons .map-icon.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.25);
}

.browse-world-icons .map-icon.is-active .frame-window {
  animation: icon-gold-flash 0.8s ease-out;
  filter: drop-shadow(0 0 10px rgba(255, 214, 120, 0.6));
}

@keyframes icon-gold-flash {
  0% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(255, 214, 120, 0));
  }
  30% {
    filter: brightness(1.7) drop-shadow(0 0 20px rgba(255, 214, 120, 0.95));
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 10px rgba(255, 214, 120, 0.6));
  }
}

.browse-jumpbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(20, 16, 10, 0.45);
  overflow-x: auto;
  overflow-y: visible;
}

.browse-jump-item {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: #f6efdf;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.browse-jump-item.is-active {
  opacity: 1;
  transform: scale(1.12);
}

.browse-jump-item.is-active .frame-window {
  filter: drop-shadow(0 0 8px rgba(255, 214, 120, 0.8));
}

.browse-jump-all {
  width: auto;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(201, 166, 117, 0.85);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: #f6efdf;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 2px rgba(138, 109, 63, 0.5),
    inset 0 0 0 1px rgba(227, 201, 140, 0.25);
  opacity: 1;
  transition: background 0.2s, box-shadow 0.2s;
}

.browse-jump-all.is-active {
  background: rgba(255, 255, 255, 0.35);
  box-shadow:
    0 0 0 2px rgba(138, 109, 63, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transform: none;
}

.browse-jump-all:hover {
  background: rgba(255, 255, 255, 0.22);
}

.browse-detail {
  position: relative;
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  overflow-y: auto;
  display: flex;

  align-items: flex-start;

  background-color: var(--cover-bg-color, transparent);
  transition: background-color 0.4s ease;
}

.browse-detail-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.browse-detail-cover.is-visible {
  opacity: 1;
}

.browse-detail-inner {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

@media (min-width: 901px) {
  .browse-detail-inner.has-cover {
    position: absolute;
    top: auto;
    left: 32px;
    right: 32px;
    bottom: 32px;
    width: auto;
    max-height: 60%;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    border-radius: var(--radius-lg);
  }

  .browse-detail-cover {
    object-fit: cover;
    object-position: center 78%;
  }
}

.browse-detail-inner.has-cover {
  padding: 0;
}

.browse-detail-inner {
  width: 100%;
  padding: 56px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.browse-detail-inner.is-fading {
  opacity: 0;
  transform: translateY(10px);
}

.detail-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.detail-heading h2 {
  flex: 1 1 0%;
  min-width: 0;
}

.links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.read-link {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;

  background: #98825d;
  color: #fff;
  font-family: var(--font-prose);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(255, 244, 214, 0.6);
  box-shadow:
    0 0 0 2px rgba(138, 109, 63, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s, box-shadow 0.2s;
}

.read-link:hover {
  opacity: 0.85;
  box-shadow:
    0 0 0 2px rgba(138, 109, 63, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.browse-detail-card {
  background: rgba(246, 239, 223, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft);
  transition: background-color 0.25s ease;
}

.browse-detail-card:hover {
  background-color: rgba(246, 239, 223, 0.9);
}

.synopsis {
  background: rgba(239, 228, 204, 0.9);
  border-left: 4px solid var(--color-accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-family: var(--font-prose);
  font-size: 0.8rem;
  line-height: 1.8;
}

.browse-detail-card .synopsis {
  background: none;
  border-left: none;
  border-radius: 0;
  padding: 0;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-soft);
}

.browse-detail,
.browse-detail-inner.has-cover {
  scrollbar-color: rgba(138, 109, 63, 0.55) transparent;
  scrollbar-width: thin;
}

.browse-detail::-webkit-scrollbar,
.browse-detail-inner.has-cover::-webkit-scrollbar {
  width: 10px;
}

.browse-detail::-webkit-scrollbar-track,
.browse-detail-inner.has-cover::-webkit-scrollbar-track {
  background: transparent;
}

.browse-detail::-webkit-scrollbar-thumb,
.browse-detail-inner.has-cover::-webkit-scrollbar-thumb {
  background-color: rgba(138, 109, 63, 0.55);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.browse-detail::-webkit-scrollbar-thumb:hover,
.browse-detail-inner.has-cover::-webkit-scrollbar-thumb:hover {
  background-color: rgba(138, 109, 63, 0.75);
}

.all-list {
  max-width: 480px;
  margin: 0 auto;
}

.all-list h1 {
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.all-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}

.all-list li {
  border-bottom: 1px solid var(--color-line);
}

.all-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: padding-left 0.2s, opacity 0.2s;
}

.all-list-icon {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.all-list-icon img.character-thumb {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  object-fit: cover;
}

.all-list-icon img.deco-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.all-list-item span {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--color-text);
}

.all-list-item:hover {
  padding-left: 16px;
  opacity: 0.75;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    padding: 16px 20px;
  }

  .menu-toggle {
    display: flex;
  }

  .sns-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    background: #e8dabf;
    border-top: 1px solid var(--color-line);
    transition: max-height 0.3s ease;
  }

  .sns-links.is-open {
    max-height: 240px;
  }

  .sns-links li {
    width: 100%;
  }

  .sns-links a {
    display: block;
    padding: 14px 20px;
  }

  .map-icon {
    width: 84px;
    height: 84px;
  }

  .browse-detail-inner {
    padding: 32px 20px;
  }
}

@media (max-width: 900px) {
  #browse-root {
    height: auto;
  }

  .browse {
    flex-direction: column;
    height: auto;
  }

  .browse-camera {
    flex: 0 0 auto;
    width: 100%;
    height: 46vh;
  }

  .browse-detail {
    flex: none;
    width: 100%;
    height: auto;
    min-height: var(--cover-fixed-height, 0);
    overflow: visible;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 画像は十分に長い前提でcoverし、カードの実際の高さに合わせて
     表示エリアだけ決める（余った下部は表示しない＝切れてよい）。
     これなら画像の下部がベタ塗りの余白として見えることが無くなる */
  .browse-detail-cover {
    inset: auto;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cover-fixed-height, 50vh);
  }

  .jumpbar-sentinel {
    position: absolute;
    bottom: 64px;
    left: 0;
    right: 0;
    height: 1px;
    pointer-events: none;
  }

  .browse-jumpbar.is-stuck {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 20;
  }

  .scroll-hint {
    display: none;
  }

  .detail-scroll-hint {
    display: flex;
  }

  .browse-detail-inner.has-cover {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;

    margin-top: var(--cover-overlap-top, 50%);
    padding-bottom: 72px;
  }

  .detail-heading {
    flex-direction: column;
    align-items: center;
  }

  .detail-heading h2 {
    flex: none;
    width: 100%;
  }

  .browse-detail-card {
    background: rgba(246, 239, 223, 0.9);
  }

  .sns-links a {
    display: block;
    width: 100%;
    height: auto;
    padding: 20px 20px;
    font-size: 1.05rem;
  }

  .sns-links.is-open {
    max-height: 320px;
  }
}

.contact-wrap {
  max-width: 640px;
  padding-top: 56px;
  padding-bottom: 80px;
}

.contact-back {
  display: inline-block;
  margin-bottom: 24px;
  font-family: var(--font-prose);
  font-size: 0.85rem;
  color: var(--color-text-soft);
  transition: opacity 0.2s ease;
}

.contact-back:hover {
  opacity: 0.7;
}

.contact-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.contact-lead {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-bottom: 32px;
  line-height: 1.9;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: 10px;
  padding: 10px 14px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: #98825d;
}

.contact-submit {
  align-self: center;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.contact-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-status {
  min-height: 1.4em;
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
}

.contact-status.is-success {
  color: #8a6d3f;
}

.contact-status.is-error {
  color: #b3382c;
}

@media (max-width: 900px) {
  .contact-wrap {
    padding-top: 32px;
  }

  .contact-form {
    padding: 24px 20px;
  }
}
