:root {
  --bg: #171323;
  --bg-accent: #241933;
  --bg-soft: #32203d;
  --card: rgba(30, 23, 43, 0.84);
  --line: rgba(214, 185, 255, 0.14);
  --text: #fff6ed;
  --muted: #e6d6ea;
  --muted-strong: #f2e7f4;
  --ink-dark: #170f21;
  --pink: #ff9dc6;
  --sky: #8de0da;
  --sun: #ffc86f;
  --shadow: 0 22px 44px rgba(4, 2, 10, 0.42);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background:
    linear-gradient(180deg, rgba(8, 6, 16, 0.28), rgba(8, 6, 16, 0.5)),
    url("images/site-bg.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: 1;
  background:
    radial-gradient(circle at 37% 13%, rgba(255, 234, 196, 0.22), transparent 8%),
    radial-gradient(circle at 62% 22%, rgba(255, 201, 111, 0.18), transparent 9%),
    radial-gradient(circle at 14% 72%, rgba(255, 181, 110, 0.1), transparent 14%),
    radial-gradient(circle at 78% 78%, rgba(151, 118, 255, 0.1), transparent 18%),
    linear-gradient(180deg, rgba(8, 6, 16, 0.02) 0%, rgba(8, 6, 16, 0.22) 52%, rgba(8, 6, 16, 0.5) 100%);
  mix-blend-mode: screen;
}

body::after {
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 5, 14, 0.52) 0%, rgba(14, 10, 24, 0.2) 22%, rgba(16, 11, 26, 0.3) 58%, rgba(7, 5, 14, 0.66) 100%);
}

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

a {
  color: #8cd9ff;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 28px;
  margin-top: 14px;
  background:
    radial-gradient(circle at top right, rgba(255, 200, 111, 0.14), transparent 24%),
    radial-gradient(circle at left center, rgba(255, 157, 198, 0.12), transparent 26%),
    linear-gradient(135deg, rgba(28, 20, 43, 0.94), rgba(41, 22, 37, 0.94));
  border: 1px solid rgba(255, 226, 176, 0.18);
  border-radius: 36px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 10px;
  color: #ffbf7a;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.04;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-badge {
  min-width: 150px;
  padding: 18px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(46, 27, 39, 0.92) 0%, rgba(85, 43, 54, 0.88) 100%);
  text-align: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 211, 155, 0.18),
    0 0 24px rgba(255, 161, 104, 0.14);
}

.hero-badge span,
.hero-badge small {
  display: block;
  color: var(--muted);
}

.hero-badge strong {
  display: block;
  margin: 4px 0;
  font-size: 2.5rem;
  color: #ffd48f;
  text-shadow: 0 0 18px rgba(255, 164, 84, 0.32);
}

.meta-strip {
  display: flex;
  justify-content: flex-end;
  margin: 24px 0 18px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.yokai-card {
  background: var(--card);
  border: 1px solid rgba(255, 215, 162, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  backdrop-filter: blur(10px);
}

.yokai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.34);
}

.card-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.card-image-wrap {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 200, 111, 0.14), transparent 18%),
    linear-gradient(180deg, rgba(38, 26, 57, 0.96), rgba(24, 18, 35, 0.98));
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 16px;
}

.card-no {
  margin: 0 0 8px;
  color: #ff9eb9;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
}

.card-name {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.card-summary,
.card-serif {
  margin: 10px 0 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

.card-serif {
  min-height: 2.8em;
  color: #ffd7e6;
  font-size: 0.95rem;
}

.card-link-text {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 157, 198, 0.14);
  color: #ffc4dc;
  font-size: 0.88rem;
}

.card-footer {
  margin: 0;
  padding: 0 16px 16px;
}

.card-link {
  display: inline-block;
  font-size: 0.92rem;
}

.detail-modal {
  width: min(920px, calc(100% - 20px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
}

.detail-modal::backdrop {
  background: rgba(9, 6, 18, 0.76);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: 0;
  overflow: hidden;
  max-height: calc(100vh - 28px);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 200, 111, 0.08), transparent 22%),
    linear-gradient(135deg, rgba(22, 16, 34, 0.98), rgba(35, 22, 42, 0.98));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

.modal-media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 200, 111, 0.14), transparent 18%),
    radial-gradient(circle at bottom right, rgba(255, 157, 198, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(32, 22, 46, 1), rgba(25, 18, 35, 1));
}

.modal-media img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 64px);
  min-height: 320px;
  object-fit: contain;
  border-radius: 24px;
}

.modal-body {
  padding: 28px 24px 24px;
  overflow: auto;
  color: var(--text);
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.modal-no {
  margin: 0;
  color: #ff9eb9;
  letter-spacing: 0.12em;
}

.modal-nav-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 214, 170, 0.14);
  border-radius: 999px;
  background: rgba(255, 243, 220, 0.05);
}

.modal-nav {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 243, 220, 0.08);
  color: #fff1d0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.modal-nav:hover {
  background: rgba(255, 243, 220, 0.16);
  transform: translateY(-1px);
}

.modal-nav:disabled {
  opacity: 0.24;
  cursor: default;
  transform: none;
}

.modal-nav[aria-hidden="true"] {
  opacity: 0.16;
}

.modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 240, 220, 0.92);
  color: #3c2a24;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.modal-close:hover {
  transform: translateY(-1px);
}

.modal-body h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--text);
}

.modal-summary {
  margin: 0 0 18px;
  color: var(--muted-strong);
  line-height: 1.7;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list div {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 243, 220, 0.06);
  border: 1px solid rgba(255, 208, 148, 0.08);
}

.detail-list dt {
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff3c9;
}

.detail-list dd {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.8;
  white-space: pre-wrap;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(31, 22, 45, 0.84);
  border-radius: var(--radius-lg);
}

@media (max-width: 820px) {
  body {
    background-position: 58% top;
    background-attachment: scroll;
  }

  .hero,
  .modal-card {
    grid-template-columns: 1fr;
  }

  .modal-card {
    max-height: none;
  }

  .modal-media {
    padding: 0;
  }

  .modal-media img {
    max-height: none;
    border-radius: 0;
  }

  .hero-badge {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  body {
    background-position: 63% top;
    background-size: auto 100%;
  }

  body::before {
    background:
      radial-gradient(circle at 50% 12%, rgba(255, 234, 196, 0.2), transparent 10%),
      radial-gradient(circle at 62% 24%, rgba(255, 201, 111, 0.16), transparent 10%),
      linear-gradient(180deg, rgba(8, 6, 16, 0.08) 0%, rgba(8, 6, 16, 0.32) 48%, rgba(8, 6, 16, 0.58) 100%);
  }

  .page-shell {
    width: min(100% - 16px, 1180px);
    padding-bottom: 36px;
  }

  .hero {
    padding: 22px 18px;
    border-radius: 28px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 22px 18px 18px;
  }

  .modal-toolbar {
    gap: 10px;
    align-items: flex-start;
  }

  .modal-actions {
    gap: 8px;
  }

  .modal-nav-inline {
    padding: 4px;
  }

  .modal-nav {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}
