::selection {
  background: #fff1cc;
}

body, h1, h2, h3, h4, ul, ol, p, figure, dialog {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: #ff0037;
}
a:hover {
  color: #ffb700;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: linear-gradient(#fffacd, #d1fdfe);
  font-size: max(0.5dvw, 10px);
  font-family: "Noto Sans JP", sans-serif;
  color: #161f43;
}

body {
  display: grid;
  justify-content: center;
  min-height: 100dvh;
  padding: 6rem 3rem;
}
@media (min-width: 720px) {
  body {
    grid-template-columns: minmax(-webkit-min-content, 720px);
    grid-template-columns: minmax(min-content, 720px);
  }
}
@media (max-width: 719px) {
  body {
    grid-template-columns: 100%;
    padding: 2rem 2rem 4.5rem;
  }
}
body.illust {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
  min-height: 100dvh;
  padding: 0;
  text-align: center;
}
body.illust div.buttons {
  background: #fff;
  padding: 0 0 2rem;
}
body.novel_index {
  text-align: center;
}
body.novel_index h2 {
  text-align: left;
}
body.novel {
  text-align: center;
}
@media (max-width: 719px) {
  body.novel {
    padding: 0.5rem;
  }
}
body.novel main {
  border: 0;
}
@media (min-width: 720px) {
  body.novel main {
    grid-column: 1/2;
  }
}
body.novel main::after {
  display: none;
}
body.novel article.novel {
  line-height: 2em;
  font-size: 1.5rem;
  text-align: left;
}
body.novel article.novel h1, body.novel article.novel h2, body.novel article.novel h3 {
  margin-bottom: -2rem;
}
body.novel article.novel h4 {
  margin-bottom: -1.11rem;
}

@-webkit-keyframes loader {
  100% {
    background-position: 100% 0, 100% 100%, 0 100%, 0 0;
  }
}

@keyframes loader {
  100% {
    background-position: 100% 0, 100% 100%, 0 100%, 0 0;
  }
}
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  background: rgba(4, 22, 95, 0.9);
  inset: 0;
}
.loader.is-hidden {
  display: none;
  pointer-events: none;
}
.loader > div {
  width: 35px;
  aspect-ratio: 1;
  --_g: no-repeat radial-gradient(farthest-side,#ffb700 94%,#0000);
  background: var(--_g) 0 0, var(--_g) 100% 0, var(--_g) 100% 100%, var(--_g) 0 100%;
  background-size: 40% 40%;
  -webkit-animation: loader 0.5s infinite;
          animation: loader 0.5s infinite;
}

button.switch {
  position: fixed;
  background: #ffb700;
  border: 0;
  border-radius: 50%;
  width: 5rem;
  height: 5rem;
  left: 0;
  right: 0;
  top: 3.5rem;
  margin: 0 auto;
  padding: 0;
  line-height: 1em;
  font-size: 1.3rem;
  font-weight: 500;
  font-family: inherit;
  color: #161f43;
  -webkit-appearance: none;
          appearance: none;
  overflow: hidden;
  cursor: pointer;
  z-index: 100;
}
@media (max-width: 719px) {
  button.switch {
    top: calc(100% - 7rem);
    transition: top 0.2s ease 0s;
  }
}
button.switch::before, button.switch::after {
  position: absolute;
  background: #161f43;
  border-radius: 0.3rem;
  width: 50%;
  height: 0.25rem;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  pointer-events: none;
}
button.switch::before {
  rotate: 45deg;
}
button.switch::after {
  rotate: -45deg;
}
button.switch:hover::before, button.switch:hover::after {
  background: #ff0037;
}
button.switch:active {
  scale: 0.8;
}
button.switch.is-opened {
  color: transparent;
}
@media (max-width: 719px) {
  button.switch.is-opened {
    top: 1.5rem;
  }
}
button.switch.is-opened::before, button.switch.is-opened::after {
  content: "";
}
button.switch.is-opened + nav {
  translate: 0 0;
  pointer-events: all;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 2rem;
  position: fixed;
  background: rgba(4, 22, 95, 0.8);
  width: calc(100% - 6rem);
  height: 42rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  padding: 14rem 0 0;
  translate: 0 calc(-100% - 1rem);
  transition: translate 0.2s ease 0s;
  z-index: 50;
  pointer-events: none;
}
@media (min-width: 720px) {
  nav {
    top: 0;
  }
}
@media (max-width: 719px) {
  nav {
    justify-content: center;
    width: calc(100% - 4rem);
    height: calc(100dvh - 4rem);
    bottom: 0;
    padding: 4rem 0;
    translate: 0 calc(100% + 1rem);
  }
}
nav a {
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-column-gap: 0.2em;
     -moz-column-gap: 0.2em;
          column-gap: 0.2em;
  position: relative;
  background: #ffb700;
  border-radius: 2.5em;
  min-width: 9em;
  height: 2.5em;
  line-height: 1.5em;
  font-size: 1.7rem;
  text-decoration: none;
  fill: #161f43;
  color: #161f43;
}
nav a svg {
  width: 1em;
  height: 1em;
}
nav a:hover {
  fill: #ff0037;
  color: #ff0037;
}
nav a:active {
  scale: 0.8;
}

main {
  position: relative;
  background: #fff;
  border-radius: 3rem;
  padding: 5rem 3rem 3rem;
}
@media (min-width: 720px) {
  main {
    height: 100%;
  }
}
@media (max-width: 719px) {
  main {
    border-radius: 2rem;
    padding: 2rem 2rem 4rem;
  }
}
main > aside {
  margin-bottom: 2rem;
  line-height: 1em;
  font-size: 3rem;
  text-align: center;
  color: #161f43;
  text-shadow: 0 0.1rem 0 #ffb700;
  z-index: -1;
}

article {
  position: relative;
}
article + article {
  margin-top: 4rem;
}

section {
  position: relative;
}
section + section {
  margin-top: 2rem;
}

h1 {
  position: relative;
  background: #fff1cc;
  border-left: 0.211em solid #ffb700;
  padding: 0.369em 2em 0.369em 0.6em;
  letter-spacing: 0.05em;
  line-height: 1.316em;
  font-size: 1.9rem;
  font-weight: 500;
}
h1::after {
  content: "";
  position: absolute;
  background: #ffb700;
  border-radius: 50%;
  width: 0.5em;
  height: 0.5em;
  right: 0.7em;
  top: 0;
  bottom: 0;
  margin: auto 0;
  pointer-events: none;
}
h1::first-letter {
  color: #ff0037;
}
h1 + * {
  margin-top: 2rem;
}
h1 + ul.novel {
  margin-top: 1.5rem;
}
h1 + ul.illust {
  margin-top: 2.5rem;
}

h2 {
  position: relative;
  padding: 0.295em 0.6em 0.236em 0.2em;
  letter-spacing: 0.06em;
  line-height: 1.3em;
  font-size: 1.7rem;
  font-weight: 500;
}
h2::before, h2::after {
  content: "";
  position: absolute;
  right: 0;
  pointer-events: none;
}
h2::before {
  background: linear-gradient(to right, #ff0037 1.3em, #ffb700 1.3em);
  border-radius: 0.236em;
  height: 0.177em;
  left: 0;
  bottom: 0;
}
h2::after {
  background: #ffb700;
  border-radius: 50%;
  width: 0.6em;
  height: 0.6em;
  bottom: 0.118em;
  translate: 0 50%;
}
h2::first-letter {
  color: #ff0037;
}
h2 + * {
  margin-top: 1.8rem;
}

h3 {
  position: relative;
  padding: 0.295em 0 0 0.2em;
  letter-spacing: 0.04em;
  line-height: 1.3em;
  font-size: 1.7rem;
  font-weight: 500;
}
h3::before {
  content: "";
  display: inline-block;
  background: #ffb700;
  border-radius: 50%;
  width: 0.6em;
  height: 0.6em;
  translate: 0 -5%;
}
h3::before {
  margin-right: 0.3em;
}
h3 + * {
  margin-top: 0.4rem;
}

h4 {
  position: relative;
  line-height: 1.4em;
  font-size: 1.7rem;
  font-weight: 500;
}

p {
  position: relative;
  line-height: 1.934em;
  font-size: 1.5rem;
}

div.buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: 2rem;
  position: relative;
}
div.buttons a {
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-column-gap: 0.2em;
     -moz-column-gap: 0.2em;
          column-gap: 0.2em;
  position: relative;
  background: #ffb700;
  border-radius: 2.5em;
  min-width: 9em;
  height: 2.5em;
  line-height: 1.5em;
  font-size: 1.7rem;
  text-decoration: none;
  fill: #161f43;
  color: #161f43;
  cursor: pointer;
}
div.buttons a svg {
  width: 1em;
  height: 1em;
}
div.buttons a.back svg {
  scale: -1 1;
}
div.buttons a.zoomin svg:nth-of-type(2) {
  display: none;
}
div.buttons a.zoomout svg:nth-of-type(1) {
  display: none;
}
div.buttons a:hover {
  fill: #ff0037;
  color: #ff0037;
}
div.buttons a:active {
  scale: 0.8;
}

ol.news {
  display: flex;
  flex-direction: column;
  position: relative;
}
ol.news > li {
  display: grid;
  grid-template-columns: -webkit-min-content 1fr;
  grid-template-columns: min-content 1fr;
  -webkit-column-gap: 1rem;
     -moz-column-gap: 1rem;
          column-gap: 1rem;
  row-gap: 1rem;
  position: relative;
  padding: 1.5rem 0;
}
@media (max-width: 719px) {
  ol.news > li {
    grid-template-columns: 100%;
  }
}
ol.news > li time {
  grid-column: 1/2;
  line-height: 1.4em;
  font-size: 1.5rem;
}
ol.news > li p {
  line-height: 1.4em;
  font-size: 1.5rem;
}
@media (min-width: 720px) {
  ol.news > li p {
    grid-column: 2/3;
  }
}
ol.news > li + li {
  border-top: 0.1rem solid #ffb700;
}
ol.news > li:first-of-type {
  padding-top: 0.5rem;
}
ol.news > li:last-of-type {
  padding-bottom: 0;
}

ul.illust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  -webkit-column-gap: 1rem;
     -moz-column-gap: 1rem;
          column-gap: 1rem;
  row-gap: 1rem;
  position: relative;
  padding: 0 0 1rem;
}
@media (min-width: 720px) {
  ul.illust {
    grid-template-columns: repeat(6, 1fr);
  }
}
ul.illust > li {
  aspect-ratio: 4/3;
}
ul.illust > li a {
  display: block;
  position: relative;
  background: #ffb700;
  border-radius: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 0.4rem;
  overflow: hidden;
}
ul.illust > li a img {
  -o-object-fit: cover;
     object-fit: cover;
  width: 100%;
  height: 100%;
}
ul.illust > li a:hover {
  background: #beddff;
}
ul.illust > li a:active img {
  scale: 1.2;
}

ul.novel {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  line-height: 1.934em;
  font-size: 1.5rem;
}
ul.novel > li {
  margin-right: 0.7em;
}
ul.novel > li::after {
  content: "/";
  margin-left: 0.4em;
}
ul.novel > li:last-of-type {
  margin-right: 0;
}
ul.novel > li:last-of-type::after {
  display: none;
}

figure.illust {
  position: relative;
  max-width: 100dvw;
}
figure.illust:not(.zoomin) img {
  max-width: 100dvw;
  max-height: 100dvh;
}
figure.illust.zoomin {
  overflow-x: auto;
}

/* --- 追加したやつ --- */
.wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    /* スマートフォンでのデフォルト（100%幅）はメディアクエリで設定 */
    width: 100%; /* デフォルトは1列表示 */
    max-width: 100%; /* 念の為最大幅を設定 */
    
    word-wrap: break-word;
    background-color: #fff;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #333;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* transitionにbox-shadowも追加 */
}

.card-image-box {
    overflow: hidden;
}

.card-image {
    width: 100%;
    /* 高さを固定値からより柔軟な値に変更（ここではビューポート幅ベース） */
    height: 200px; /* デフォルトは固定値を維持しつつ、必要に応じて調整 */
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.card-box {
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.card-description {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.card:hover {
    transform: translateY(-5px); /* scaleよりも自然な動きに変更 */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card:hover .card-image {
    transform: scale(1.05); /* ホバー時のズーム効果を画像に移動 */
}

/* --- レスポンシブ対応のためのメディアクエリ --- */

/* 画面幅が600px以上の場合 (タブレットや小さなPC) */
@media (min-width: 600px) {
    .card {
        /* 2列表示 (50%からgap分(1rem)を引いた値をcalc()で計算) */
        width: calc(50% - 0.5rem); 
    }
    .card-image {
        /* タブレットでは画像を少し小さめに */
        height: 180px;
    }
}

/* 画面幅が1024px以上の場合 (デスクトップPC) */
@media (min-width: 1024px) {
    .card {
        /* 3列表示 (33.333%からgap分(1rem)を引いた値をcalc()で計算) */
        width: calc(33.333% - 0.666rem); 
    }
    .card-image {
        /* デスクトップでは元の高さを維持 */
        height: 200px;
    }
}