:root {
  --bg: #fff4f7;
  --bg-deep: #ffe6ee;
  --card: #ffffff;
  --line: #f7c9d8;
  --pink: #e8648f;
  --pink-soft: #fde3eb;
  --text: #4f3540;
  --text-sub: #8a6875;
  --shadow: 0 2px 8px rgba(214, 96, 136, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic",
    "Yu Gothic UI", "Meiryo", sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- トップページ（1画面に15ジャンル） ---------- */

.home {
  height: 100vh;
  height: 100dvh;
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(6px, 1.6vh, 16px);
  padding: clamp(8px, 2vh, 20px) clamp(10px, 2.5vw, 32px);
  max-width: 1200px;
  margin: 0 auto;
}

.home-head {
  text-align: center;
}

.home-head h1 {
  margin: 0;
  font-size: clamp(22px, 4.6vh, 38px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pink);
  line-height: 1.25;
}

.home-head p {
  margin: 2px 0 0;
  font-size: clamp(11px, 1.9vh, 15px);
  color: var(--text-sub);
}

.home main {
  min-height: 0;
}

.genres {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(6px, 1.4vh, 16px);
}

.genres li {
  min-width: 0;
  min-height: 0;
}

.genre {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1px, 0.6vh, 8px);
  padding: 4px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: clamp(12px, 2.4vh, 22px);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}

.genre:hover,
.genre:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pink);
  background: #fffafc;
  outline: none;
}

.genre:focus-visible {
  box-shadow: 0 0 0 4px var(--pink-soft), var(--shadow);
}

.genre-icon {
  font-size: clamp(22px, 5.4vh, 46px);
  line-height: 1.1;
}

.genre-name {
  font-size: clamp(12px, 2.3vh, 18px);
  font-weight: 700;
  line-height: 1.25;
}

.genre-count {
  font-size: clamp(10px, 1.6vh, 13px);
  color: var(--pink);
  background: var(--pink-soft);
  border-radius: 999px;
  padding: 0 10px;
  line-height: 1.6;
}

.home-foot {
  text-align: center;
  font-size: clamp(10px, 1.5vh, 12px);
  color: var(--text-sub);
}

/* たて長の画面（スマホなど）は 3列 × 5段 */
@media (max-aspect-ratio: 1/1) {
  .genres {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: clamp(6px, 1vh, 12px);
  }

  .genre-icon {
    font-size: clamp(22px, 4vh, 40px);
  }

  .genre-name {
    font-size: clamp(12px, 1.8vh, 17px);
  }
}

/* ---------- ジャンルごとのページ ---------- */

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.back {
  display: inline-block;
  padding: 6px 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--pink);
  font-weight: 700;
}

.back:hover,
.back:focus-visible {
  border-color: var(--pink);
  outline: none;
}

.page-head {
  text-align: center;
  margin: 20px 0 24px;
}

.page-icon {
  font-size: 52px;
  line-height: 1.1;
}

.page-head h1 {
  margin: 4px 0 0;
  font-size: 28px;
  color: var(--pink);
}

.page-head p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-sub);
}

.works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.work {
  display: block;
  height: 100%;
  padding: 16px 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.work:hover,
.work:focus-visible {
  transform: translateY(-2px);
  border-color: var(--pink);
  outline: none;
}

.work-title {
  font-size: 17px;
  font-weight: 700;
}

.work-note {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-sub);
}

.work-date {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pink);
}

.empty {
  padding: 40px 16px;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--text-sub);
}

.empty-icon {
  font-size: 40px;
}

@media (prefers-reduced-motion: reduce) {
  .genre,
  .work {
    transition: none;
  }
}
