.subject-card {
  display: block;
  padding: 30px 20px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 10px;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.subject-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.subject-icon {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto 10px;
}

/* 科目ごとの背景色 */
.math { background-color: #8EB8FF; }
.physics { background-color: #B38CFF; }
.chemistry { background-color: #FFFF99; color: black; }
.english { background-color: #FFB38C; }

.subject-grid {
  display: grid;
  grid-template-columns: 1fr; /* デフォルト(スマホ)は1列 */
  gap: 20px;
  padding: 20px;
}

/* タブレット以上(横幅600px〜) */
@media (min-width: 600px) {
  .subject-grid {
    grid-template-columns: repeat(2, 1fr); /* 2列 */
  }
}

/* PC以上(横幅900px〜) */
@media (min-width: 900px) {
  .subject-grid {
    grid-template-columns: repeat(3, 1fr); /* 3列 */
  }
}
