/* Google FontsからPoppinsフォントをインポート */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

html, body {
  height: 100%; /* bodyとhtmlの高さを100%に設定 */
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 1), #F5F5F5 60%, #E0E0E0 100%);
  height: 100vh; /* これにより、アドレスバー非表示時の高さが反映される */
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

header, footer {
  background: none; /* 背景をなし（透明）に設定 */
  color: #333;
  text-align: center;
  padding: 5px;
  max-width:1000px;
  margin: 0 auto;
}

h1 {
    text-align: center;
    color: #333;
    font-size: 24px;
    font-weight: 700; /* 太字で強調 */
}

.grid-container {
  max-width:1000px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 常に4列表示 */
  grid-template-rows: 150px 150px 150px 150px;
  gap: 8px;
  margin: 0 auto;
  padding: 10px;
}

.grid-item {
  display: block;
  padding: 0px;
  text-align: center;
  text-decoration: none;
  color: #333; 
  pointer-events: none; /* グリッドアイテム全体のクリックイベントを無効化 */
}

.grid-item img {
  width: 100%;
  max-width: 80px; /* アイコンの最大サイズを80pxに設定 */
  height: auto;
  border-radius: 15px; /* iPhoneのアイコンのように角丸に設定 */
  pointer-events: auto; /* アイコン画像部分のみクリック可能にする */
  cursor: pointer; /* アイコン画像にのみカーソルを変更 */
}

.grid-item p {
  font-size: 12px;
  margin-top: 5px;
  line-height: 1;
  color: #333; 
}

.grid-item img {
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); /* 薄い影を付ける */
  transition: box-shadow 0.3s ease; /* ホバー時の滑らかな変化 */
}

.grid-item img:hover {
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3); /* ホバー時に少し強調 */
}


.carousel {
  grid-column: 1 / -1;
  padding: 1em; /* 上下左右すべて1文字分の余白を追加 */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  margin: 20px;
  overflow: hidden;
  position: relative;
  min-height: 2em; /* デフォルトの縦幅を2文字分に設定 */
}

.carousel-item {
  display: none;
  opacity: 0;
  position: absolute;
  top: 50%; /* 垂直中央揃え */
  left: 50%; /* 水平中央揃え */
  transform: translate(-50%, -50%); /* 中央に表示するための変換 */
  width: 100%;
  text-align: center; /* テキストを中央揃え */
  transition: opacity 1s ease-in-out;
}

.carousel-item.active {
  display: block;
  opacity: 1;
}




@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

footer {
  padding: 5px;
  margin-top: 0; /* フッター直前の余白をなくす */
}

/* 画面幅が768px以下の場合 */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 135px 135px 135px 135px;
    gap: 5px;
    min-height: auto; /* 余白を調整する */
    margin-bottom: 0; /* フッターの直前まで余白をなくす */
    padding: 10px;
  }

  .grid-item img {
    max-width: 70px; /* 小さい画面でもアイコンを縮小 */
  }

  .carousel {
    padding: 15px;
    font-size: 14px;
    margin: 15px;
  }
}

/* iPhone SEなどの小さい画面 */
@media (max-width: 375px) {
  .grid-container {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 120px 120px 120px 120px;
    gap: 2px;
    min-height: auto; /* 余白を調整する */
    margin-bottom: 0; /* フッターの直前まで余白をなくす */
    padding: 5px;
  }

  .grid-item img {
    max-width: 60px; /* 小さい画面ではアイコンをさらに縮小 */
  }

  .carousel {
    padding: 10px;
    font-size: 12px;
    margin: 10px;
  }
}

@media (max-width: 768px) {
  /* モバイル用のスタイル */
  header {
    text-align: center;
  }
}
