:root {
  --bg: #f4f0e8;
  --panel: #fffaf2;
  --line: #d8cdb7;
  --text: #2f2a24;
  --muted: #6f6558;
  --accent: #b95c2e;
  --accent-strong: #8f3c14;
  --nav-bg: #efe2ca;
  --shadow: 0 12px 30px rgba(73, 53, 27, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --site-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 244, 221, 0.95), rgba(244, 240, 232, 0) 28rem),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 100%);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-shell {
  width: min(calc(100% - 32px), var(--site-width));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header {
  margin-bottom: 20px;
}

.site-header__kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-header__title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.15;
}

.site-header__lead {
  max-width: 60rem;
  margin: 14px 0 0;
  color: var(--muted);
}

.novel-section {
  margin-bottom: 24px;
}

.novel-frame {
  width: min(100%, 672px);
  aspect-ratio: 672 / 448;
  border: 4px solid rgba(185, 92, 46, 0.16);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}

.novel-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.content {
  display: grid;
  gap: 20px;
}

.content > * {
  min-width: 0;
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fffdf8 0%, var(--panel) 100%);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.room-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.room-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--nav-bg);
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.room-nav__link:hover,
.room-nav__link:focus-visible {
  transform: translateY(-1px);
  background: #f7ebd5;
}

.room-nav__link.is-current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.back-link {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.back-link__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 700;
}

.back-link__button:hover,
.back-link__button:focus-visible {
  background: #fbf4e8;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grade-card {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.grade-card__title {
  display: block;
  font-size: 1.25rem;
}

.child-list {
  margin: 0;
  padding-left: 1.2rem;
}

.child-list li + li {
  margin-top: 8px;
}

.child-list a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}

.child-list__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: #efe2ca;
  font-weight: 700;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.video-card__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.media-video {
  display: none;
  width: 100%;
  margin-top: 14px;
  border-radius: 12px;
  background: #000;
}

.media-video.is-visible {
  display: block;
}

.poem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.poem-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffef9 0%, #f8ecda 100%);
  box-shadow: var(--shadow);
}

.poem-card p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.8;
}

.yokai-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.yokai-card {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

.yokai-card__image {
  display: block;
  aspect-ratio: 1 / 1;
  background: #f3ead9;
}

.yokai-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yokai-card__label {
  display: block;
  padding: 12px;
  font-weight: 700;
}

.yokai-detail {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
}

code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: #efe8da;
  font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 900px) {
  .room-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .video-grid,
  .poem-grid,
  .yokai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--site-width));
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .room-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-nav__link {
    min-height: 48px;
    border-radius: 18px;
    font-size: 0.95rem;
  }

  .video-grid,
  .poem-grid,
  .yokai-grid {
    grid-template-columns: 1fr;
  }
}
